Log in

View Full Version : PHP Cookie


rlculver
05-25-2002, 11:49 AM
Hi all,

I am writing a PHP script as part of my project - I have put this cookie information at the top of the page: -

<?
setcookie ("cookie", "You have already voted - Results have been displayed on screen");
echo $cookie;
?>

When I visit it a second Time, I want just this information to be displayed and not process any of the other information the script carries out???

How can this be done.

Thanks

N!ck
05-28-2002, 02:27 AM
<?
if ($HTTP_COOKIE_VARS["cookie"]!="") {
echo $HTTP_COOKIE_VARS["cookie"];
exit;
}

CODE TO EXECUTE IF COOKIE IS NOT PRESENT
?>