Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Include external HTML file in TEXT_MAIN


steff

Recommended Posts

I've been trying to add a (e-mail list) form to my text_main filed, but it won't work.

 

Alternative 1:

To add a file called form.html with some kind of php include.

Tried to add <?php include("menu.inc"); ?> between my <td> and </td> in text_main, but the html file never got included. No error msgs.

 

Alternative 2:

To add the HTML code to text_main field. This returns an error (se code below).

 

My text main code in index.php:

 

define('TEXT_MAIN', '
<table width="465" border="0">
 <tr>
   <td class="main">

 I have tried to add it here, but then it outputs "TEXT_MAIN"

   </td>
 </tr>
</table>
');

 

Form to add:

 

<form name="txtlist" action="./index.php" target="txtlist" method="get" onSubmit="JavaScript:window.open('','txtlist','width=300,height=150,toolbar=no,status=no,resizable=no')">
<table border="0" cellpadding="4" cellspacing="0" bgcolor="#efefef" style="border: #dedede 3px double;">
<tr><td>
<input type="hidden" name="type" value="sub">
<input type="text" name="email" value="email address" size="20" maxlength="100" onFocus="if (this.value=='email address') this.value=''" onBlur="if (this.value=='') this.value='email address'">
<input type="submit" name="sub" value="subscribe">
</td></tr>
</table>
</form>

 

I tried putting a \ in front of all ' -but that didn't work.

 

Any ideas for how I can make this work?

Link to comment
Share on other sites

Place your html file in the root level. Then make this change to your root level php file:

 

<td class="main"><?php include ('newpage.html'); ?></td>

 

Don't forget to remove the call to the file at the 'languages' level, in the head section of your root level php file e.g.

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

 

Vger

Link to comment
Share on other sites

if you need some thing more flexible, this contribution has examples and explains how to include html as well as create popup windows in a multi-language setup:

http://www.oscommerce.com/community/contri...ch,include+html

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...