setcookie problems

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Mon Nov 25, 2002 12:17 am

Hi!
Try this:

Code: Select all

if(($username == 'testuser') && ($password == 'testpassword'))
{
  setcookie("userid"',"1", time() - 3600);
  header('Location: index.php');
  exit;
}else
{
  setcookie("userid"',"0", time() - 3600);
  header('Location: index.php');
  exit;
}

As you see firstly your script nothing to do, couse one of your variable ($username or $password) not sets.
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

Post Reply