Tomcat Posted June 11, 2003 Posted June 11, 2003 Hi, I have a strange error when trying to generate a pdf catalog with this contribution: http://www.oscommerce.com/community/contributions,908 The script creates 6 catalogs as follows ( only the 1st one showned ) : catalog_1.pdf catalog_2.pdf catalog_3.pdf catalog_4.pdf catalog_6.pdf catalog_7.pdf I only have a test category of items and only the first pdf file generated seems to be valid ( the other five are empty ) Also my server usesPHP 3 so the function : /* foreach ($foo as $key => $value) { if ($foo[$key]['parent'] == $cid) { $this->Order($key, $level+1, $foo, $cid); } } */} included in pdf_catalog.php is not supported and I had to comment it out. Any suggestion on how to replace this bit of code ( foreach ) with one suitable for php 3 ? Thanks[/code] Outside links in signatures are not allowed!
Tomcat Posted June 12, 2003 Author Posted June 12, 2003 Hi again, I found out that the problem is not php 3, but still I have the following error with the "foreach" command : Warning: Invalid argument supplied for foreach() in /home/tomcat/public_html/catalog/admin/pdf_catalogue.php on line 279 The syntiax in the pdf_catalog.php is : foreach ($foo as $key => $value) { if ($foo[$key]['parent'] == $cid) { $this->Order($key, $level+1, $foo, $cid); } } } Any suggestions ? Thanks Outside links in signatures are not allowed!
Guest Posted June 12, 2003 Posted June 12, 2003 You *do* need php4 to use 'foreach' ..... :shock: http://au2.php.net/manual/en/control-struc...res.foreach.php
Tomcat Posted June 12, 2003 Author Posted June 12, 2003 Johnson, I DO have php 4 installed, but still have a " not valid argument" for foreach....... Could you check the syntiax for me ? Many thanks Outside links in signatures are not allowed!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.