chrispy4 Posted December 15, 2004 Posted December 15, 2004 I am new to PHP and MySQL :blush: , but have played with things so far to setup shop and begin importing my products... My store has thousands of products, and most of these products have one of four descriptions that should be in the products_description field. I have been using phpMyAdmin to import the products using a CSV file, but then it hit me that I would like to be able to update all of the products_descriptions all at once in the future if I find out that I made an error or if the details on the products change.... I tried entering a snippet of PHP into the database in the products_description field on a product to include a description that could later be changed easily, like this: <?php include '/usr/local/apache/htdocs/news.php'; ?> This doesn't seem to be recognized though when the product is loaded.... :( I know this is probably really basic, but could anyone give me a hint on what I might be able to put in the products_description field to referrence a file that I can revise in the future and thereby update all products descriptions by editing the central file? :blush: Thanks for the help, Chris [email protected]
radders Posted December 15, 2004 Posted December 15, 2004 Try the Additional Description Contribution
Jan Zonjee Posted December 15, 2004 Posted December 15, 2004 Try the Additional Description Contribution or read this thread in Tips & Tricks: http://www.oscommerce.com/forums/index.php?showtopic=70099
chrispy4 Posted December 15, 2004 Author Posted December 15, 2004 Unfortunately the products i need to use this feature for are not grouped all neatly in the same categories or manufacturers. I have tried an <iframe> and that seems to get the job done, but it is not very pretty.... Any more input would be appreciated! Thanks for the help, Chris [email protected]
chrispy4 Posted December 15, 2004 Author Posted December 15, 2004 Thanks for the help!!! I feel that I am pointed in the right direction now and i have php working in the description field... I have one more real quick question though, since for some reason I can't get the include to work in this description area. Does the following look like it should be working? The top portion works, but the include statement isn't working... The news.php file is just a test file until I get this working. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="main"><tr><td><b><font color="#FF0000">'.$products_price.'</font> -1 years </b></td></tr></table> <br> '.include ('http://floormatmania.com/news.php').' For some reason I am not getting anything (see the product's page) Any clues? Thanks for helping the newbie! Thanks for the help, Chris [email protected]
Jan Zonjee Posted December 15, 2004 Posted December 15, 2004 <br> '.include ('http://floormatmania.com/news.php').'I'm not 100% sure, never tried it myself, but from that topic I understand you should use: <br>" '.include ('http://floormatmania.com/news.php').'" (double quotes around the single quotes around the dots) If all else fails, you could always try a DEFINE. If you only need a few different ones...
chrispy4 Posted December 16, 2004 Author Posted December 16, 2004 :) Well, it is working now.... The answer was not the double quotes ("), but it was in the code.... For some reason it didn't like the HTML end tags that trailed the php... In looking through the code, I realized that there was an uneccesary html </font> tag trailing the close .' on the php. I have no idea why this would have caused the problem, but when I removed it - Vwalla! Instant success... Thanks very much JanZ for helping me get to the bottom of this! Case closed (for now) Thanks for the help, Chris [email protected]
Recommended Posts
Archived
This topic is now archived and is closed to further replies.