#20141 [Opn->Bgs]: Can't get setcookie to work with CGI version.

From: Date: Mon, 28 Oct 2002 21:26:29 +0000
Subject: #20141 [Opn->Bgs]: Can't get setcookie to work with CGI version.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-23596@lists.php.net to get a copy of this message
ID: 20141 Updated by: iliaa@php.net Reported By: tim@brogdon.net -Status: Open +Status: Bogus Bug Type: Session related Operating System: Windows 2000 PHP Version: 4.2.1 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2002-10-28 15:15:08] tim@brogdon.net I have been trying to setup cookies on a new site I'm working on. However no matter what I try I can't create the cookie. The best I can tell this just doesn't work with the CGI version of PHP. I am running windows 2000 server with IIS. Below is my code to create the cookie. THANKS <?php $username = $_POST['username']; $password = $_POST['password']; include_once('homeconnect.inc'); $result = mysql_query("SELECT * from users where home_user='$username' AND home_pass='$password'"); $num = mysql_num_rows($result); // how many rows match our query? if ($num == 0) // if none? { die ("Username or password was incorrect, or you have not yet registered. <a href='signup.php'>Click Here</a> to sign up now.");} mysql_close($db); setcookie ("user", $username); header("Location: http://tim.brogdon.net/homepage/default.php"); exit; ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20141&edit=1

« previous php.bugs (#23596) next »