Hi all,

ok so im trying to build a function so people can save there favorite games on my site. I want to make it so they can have a list of there favorite games on the site so they can find them quickly.

My idea was to use cookies and store the games ID then just call the cookies and retrieve the data.

so if someone clicks the 'add to my favorites' button on game 42 a cookie is created with that id.

I checked out php.nets page: http://nl3.php.net/set_cookie

and i copied there code:

PHP Code:
// set the cookies

// after the page reloads, print them out
if (isset($_COOKIE['cookie'])) {
   foreach (
$_COOKIE['cookie'] as $name => $value) {
"$name : $value <br />\n";
but i get an error everytime, "Parse error: parse error, unexpected T_FOREACH in /home/****/public_html/myfavorites.php on line 20"

I need to store the games ID and possibly its title, and then retrieve all that info and echo it out and i need to let people delete games from there favorites list. How can i do this?