lukas Posted October 21, 2013 Report Posted October 21, 2013 Hey, Im having some trouble with the PHP code in the Shopping Cart tutorials. I have a VPS running cPanel where I upload to test my code. Im running PHP Version 5.3.21. I essentially keep getting this error: Parse error: syntax error, unexpected T_FOREACH in /home/user/public_html/oop/shopping/html/index.php on line 6 Im currently up to video 3 in the series. I checked my code for bugs, and even uploaded the finished project to see whether its something im doing, but I always get the error above. Was wondering if someone could help? Thanks in advance Quote
falkencreative Posted October 21, 2013 Report Posted October 21, 2013 Can you post the code you are working with -- the index.php file that has the error specifically? Quote
lukas Posted October 21, 2013 Author Report Posted October 21, 2013 Can you post the code you are working with -- the index.php file that has the error specifically? <?php require_once('../functions/functions.php') foreach(get_xml_catalog() as $product){ echo "<li>$product->title</li>"; } Quote
falkencreative Posted October 21, 2013 Report Posted October 21, 2013 You need a ";" at the end of this line: require_once('../functions/functions.php') Quote
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.