juandamz Posted January 20, 2010 Report Share Posted January 20, 2010 hello, im Juan Mora, i bought your "Shopping Cart" video tutorial yesterday, i followed each step and it work perfectly. i never did some of the last steps because this web page, is for a competition at my school, and it doesn't have to work all the way, by the way this is the first time i work with php. so when i finally got what i wanted for my web page, i went ahead and uploaded on my host "lithium hosting", first the index.php file couldnt find the functions.php, so what i had to do, was to put all the files in the same folder, and it work but now it just displays this: Warning: file_get_contents(catalog.xml) [function.file-get-contents]: failed to open stream: No such file or directory in/home/jdportfo/public_html/alonso/functions.php on line 11 Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /home/jdportfo/public_html/alonso/functions.php:11 Stack trace: #0 /home/jdportfo/public_html/alonso/functions.php(11): SimpleXMLElement->__construct('') #1 /home/jdportfo/public_html/alonso/templates.php(36): get_xml_catalog() #2 /home/jdportfo/public_html/alonso/index.php(16): render_products_from_xml() #3 {main} thrown in/home/jdportfo/public_html/alonso/functions.php on line 11 the project its for tomorrow and i would appreciated if you guys can help me here's the web page "http://alonso.jdportfolio.com" Quote Link to comment Share on other sites More sharing options...
administrator Posted January 20, 2010 Report Share Posted January 20, 2010 Warning: file_get_contents(catalog.xml) [function.file-get-contents]: failed to open stream: No such file or directory in/home/jdportfo/public_html/alonso/functions.php on line 11 The error message is hinting at what you need to do; PHP can't find the file: 'No such file or directory ...' So take a look at where PHP thinks the file should be, and put the file PHP is looking for there. Does that make sense? Stefan Quote Link to comment Share on other sites More sharing options...
juandamz Posted January 20, 2010 Author Report Share Posted January 20, 2010 it does make sense, and that's what i tried at first but it didnt work... here's what i did first i put all the files in the same folder and them this functions.php define('STORE_XML' , 'Catalog.xml'); /** FUNCTIONS */ function get_xml_catalog() { return new SimpleXMLElement(file_get_contents('catalog.xml')); } Quote Link to comment Share on other sites More sharing options...
juandamz Posted January 20, 2010 Author Report Share Posted January 20, 2010 OHH i got it , the Catalog.xml on the first line is capitalize and the catalog.xml on the "return" line is not define('STORE_XML' , 'Catalog.xml'); /** FUNCTIONS */ function get_xml_catalog() { return new SimpleXMLElement(file_get_contents('catalog.xml')); } i make them both capitalize and it work Quote Link to comment Share on other sites More sharing options...
administrator Posted January 20, 2010 Report Share Posted January 20, 2010 Yep, PHP is case sensitive. Now that you figured it out yourself, you will not make that mistake again easily! Good work. Stefan Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.