Jump to content

ifelse error


dreamwest

Recommended Posts

Im trying to set a cookie by url which works,  but the ifelse script doesnt seem to detect the cookie

 

 

$action= $_GET['action'];
$action2 =$_GET['option'];

if ($action == "cinema" ){
if ($action2 != "off" && $action2 != "on"){
$action2 = "off";
}
$expire=time()+60*60*24*30;
setcookie("$action", "$action2", $expire, "/" );
}


if (!isset($_COOKIE['cinema'])){
   $customize.= '<a href="/index.php?action=cinema&option=on">CinemaScope ON</a><br><hr>';
}elseif($_COOKIE['cinema']== "on"){
  $customize.= '<a href="/index.php?action=cinema&option=off">CinemaScope OFF</a><br><hr>';
}elseif ($_COOKIE['cinema']== "off"){
   $customize.= '<a href="/index.php?action=cinema&option=on">CinemaScope ON</a><br><hr>';
}
echo $customize;

Link to comment
https://forums.phpfreaks.com/topic/161224-ifelse-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.