Hi,
add session_start (); beneath the include
Replace COOKIE by SESSION
setcookie("vote[$g_uid]", $g_v, time()+3600, "/"); //g_v: the users rating [1-10]
Before you had to use session_register, now you can just assign a value to $SESSION:
$SESSION ['vote$g_uid'] = $g_v;
Don't forget to check the return value of your mysql functions !
@myql? () or die ("Error message");
Or use a if:
$Users = mysql_query ("...Users...");
if ($Users == FALSE)
{
die ("Can't select users");
}
else
{
...
}
users. is useless
Nice function but remember that giving the global scope to variables is not a good thing. That's why it's now disabled and that the PHP developers introduced _? variables.
So see, SESSION works the same way that COOKIE does. The main difference is that you don't have to set the SESSION expiration time!
Hope it helps,
JM