Vixushr Posted June 9, 2012 Share Posted June 9, 2012 Helo, Ihave one script that servers as download link for my customers to download pricelist in XML form. Script it self works but problem is that my host upgraded PHP on servers and script now works only if theres one less field to generate in XML. This is script <?php $langHr = 7; include(dirname(__FILE__).'/config/config.inc.php'); require_once(dirname(__FILE__).'/init.php'); error_reporting(0); $p=Product::getProducts(7, 0, 0, 'id_product', 'desc', false); $products=Product::getProductsProperties(7, $p); header("Content-Type: text/xml\n\n"); //print "Content-type: text/html\n\n"; echo '<?xml version="1.0" encoding="utf-8"?> <Catalog>'; foreach ($products as $row) { if($row['active']==1){ $img=Product::getCover($row['id_product']); if ($row['quantity'] >= 5) { $row['quantity'] = "5"; } echo ' <product> <ID>'.str_replace("&", "&", $row['id_product']).'</ID> <name>'.str_replace("&", "&", $row['name']).'</name> <description>'.str_replace("&", "and", strip_tags($row['description_short'])).'</description> <price>'.($row['price']*1).'</price> <quantity>'.str_replace("&", "&", $row['quantity']).'</quantity> <category>'.str_replace("&", "&", $row['category']).'</category> <link>'.$row['link'].'</link> <image>http://www.myshop/'.$shopUrl.'img/p/'.$row['id_product'].'-'.$img['id_image'].'.jpg</image> echo'</product>'; } } echo '</Catalog>'; ?> And since these server changes this script now works only if i remove one row from product data... any row, it doesnt mather... as long as theres only 7 of them? Can anybody tell me what causes this... what to change on server to make it work, or how to change a script? Thank you! V. PS: Sever was updated from php 5.2 to 5.3 Quote Link to comment https://forums.phpfreaks.com/topic/263924-help-with-one-php-script-and-settings-on-server/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 10, 2012 Share Posted June 10, 2012 A) What output do you get when there are too many fields and what exactly is wrong with the output? Show some sample data that works and some sample data that does not. B) We would need to have all the code necessary to reproduce the problem. Without the Product class, we have no way of knowing what the parameters even mean, what the code does, or what the data it returns looks like. Quote Link to comment https://forums.phpfreaks.com/topic/263924-help-with-one-php-script-and-settings-on-server/#findComment-1352679 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.