gray_bale Posted May 6, 2007 Share Posted May 6, 2007 I want to use my Oscommerce conditions of sale elsewere ??? How do I do it. The conditions.php has the following define('NAVBAR_TITLE', 'Conditions of Sale'); define('HEADING_TITLE', 'Conditions of Sale'); define('TEXT_INFORMATION', 'By purchasing go....... etc etc My other conditons.php webpage is totally outside of the catalog directory. But I am trying to use the following code on another page <?php include("\catalog\includes\languages\english\conditions.php"); echo constant(TEXT_INFORMATION); echo "help me"; ?> It echos the 'help me' message, but the include does not work, any ideas ??? Link to comment Share on other sites More sharing options...
MJP Posted May 6, 2007 Share Posted May 6, 2007 it's forward slashes you need to use, not back slashes. Link to comment Share on other sites More sharing options...
gray_bale Posted May 7, 2007 Author Share Posted May 7, 2007 Using forward slashes it still does not work. In trying other methods, such as <?php $file=fopen("..\catalog\includes\languages\english\conditions.php","r") or exit("Unable to open file!"); while (!feof($file)) { echo fgetc($file); } fclose($file); ?> It actually echos out only the TEXT_INFORMATION correctly, buy WHY? If I use <?php $file = fopen("..\catalog\includes\languages\english\conditions.php", "r") or exit("Unable to open file!"); while(!feof($file)) { echo fgets($file). "<br />"; } fclose($file); ?> It echos out /* $Id: shipping.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 os.................etc etc Link to comment Share on other sites More sharing options...
Guest Posted May 7, 2007 Share Posted May 7, 2007 it is very simple. Copy one of the oscommerce files (like the catalog\conditions.php) to the root folder (I'm guessing is where you want it). Then edit it, just before the first code line: require('includes/application_top.php'); add: chdir('catalog'); assuming the osc is installed in the catalog folder. Of course you can use a different filename. The string files remain in the osc languages folder. The only problem with this is, if you need links that point to files in the root folder you will have to add support functions or modify the tep_href_link function to handle those because you need the session. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.