Jump to content

Recommended Posts

Posted

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

Posted

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>";
}

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...