Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add a common file


Jack_mcs

Recommended Posts

I have a number of files that display a list

<ul>
<li> <a title="About the property" href="' . tep_href_link(FILENAME_ANSWERS_PROPERTY, '', 'NONSSL') . '">' . ' About the property.</a>
</li>
...
</ul>

 

Right now I have the above code in all of those files. I would like to have something like

<td class="content"><?php require(DIR_WS_INCLUDES . 'answers-links.php'); ?></td>
 

in each file but can't figure out how to do this. I created the answers-links.php file, added the common code (the list shown above) and placed it in includes. If I enclose that code in <?php ?>, it doesn't get displayed at all. If I don't use the <?php ?>, it is displayed but when I click on the links, the defines are not interpreted correctly (the browser tries to display FILENAME_ANSWERS_PROPERTY);

 

Would someone explain the correct steps for doing this?

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...