Cookies not being created?
Posted: Tue Nov 19, 2002 4:26 pm
Here's the script that is supposed to create cookies using the input 'user_name' and 'password'.
Am I doing something wrong in creating the cookies?
Code: Select all
<?
include("config.php");
//Validate username/pass against Database
$sql = "SELECT * from IamJim_users where user_name = '$user_name' and password = '$password'";
$query = mysql_query($sql);
$num = mysql_num_rows($query);
echo $num;
if($num != 1) {
echo "No such user in our database! Please <a href="/iamjim/php/login/register.php">register</a> or hit your back button and try again!";
exit;
} else {
if($num == 1) {
setcookie("IamJim_user" , $user_name , time() + 3600);
setcookie("IamJim_pass" , $password , time() + 3600);
setcookie ("IamJim_user", $password,time()+3600);
header("Location: http://www.empiregaming.net/iamjim/");
}
}
?>