Thursday, February 26, 2009

Setting and retrieving a cookie

<?

$check = "test";

$check .= $filename;

if ($test == $check)

{

print("<HTML><BODY>You have already voted. Thank you.</BODY></HTML>");

}

else

{

$rated = "test";

$rated .= $filename;

setcookie(test, $rated, time()+86400);

print("<HTML><BODY><br>You haven't voted before so I recorded your vote</BODY></HTML>");

}

?>