php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20141 Can't get setcookie to work with CGI version.
Submitted: 2002-10-28 15:15 UTC Modified: 2002-10-28 15:26 UTC
From: tim at brogdon dot net Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.2.1 OS: Windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tim at brogdon dot net
New email:
PHP Version: OS:

 

 [2002-10-28 15:15 UTC] tim at brogdon dot 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;
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-28 15:26 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Sep 27 22:01:26 2024 UTC