Forum Moderators: coopster
For cookie 'bandwidth1' I want to echo that it is set to 1 by the cookie to confirm this in the brower through regular html.
My if/else statements don't seem to be working though...heres the code I have now.
<?php
setcookie("bandwidth1","0",time()+2592000,"/");
setcookie("bandwidth2","1",time()+2592000,"/");
setcookie("bandwidth3","2",time()+2592000,"/");
?><?php
if (isset($_COOKIE["bandwidth1"])=="1")
echo "Bandwidth is 1!";
else
echo "Bandwidth is unknown";
elsif
echo "Cookie was not set?";
?>
I was looking around some more and found this...
<?php
echo "$HTTP_COOKIE_VARS[bandwidth1]";
?>
Well not with my variable but you know!
So then I put it in to my if/then statement and it WORKS! *happiness inserted here*
<?php
setcookie("bandwidth1","0",time()+2592000,"/");
?><?php
if ($HTTP_COOKIE_VARS[bandwidth1] == "0")
{
echo "IT WORKS!";
}
else
{
echo "Nop sorry";
}
?>
Yours looks strikingly similer. Thanks for your help!