Jump to content

[SOLVED] if else based on whether a cookie exists


jeff5656

Recommended Posts

When someone logs in with the correct password, it is stored in a cookie called zzzcookie.

On another page, I want to do something based on whether that cookie exists.  When I try this, it doesn't work:

 

if (isset($_COOKIE[$zzzcookie])) {	
header("Location: xray_displaypotential.php");
}
else {
header("Location: xray_newpatient.php");
} 

 

The else statement is executed even if the zzzcookie exists.

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.