setcookie problems

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

Re: setcookie problems

Post by WiZARD » 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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest