setcookie works on rh, worked on win, now not working n win

This forum is for discussing the future of the PHP Developer's Network, as well as for us to get your opinion on things.

This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
jiggy1com
Forum Newbie
Posts: 6
Joined: Sun Jul 11, 2004 11:55 pm
Location: orange county, ca

setcookie works on rh, worked on win, now not working n win

Post by jiggy1com »

http://www.jiggy1.com/php_info.php

http://buildit.samswebclub.com/php_info.php

Compare the 2 PHP versions. The first is RH, the second is Win.

I have a simple code for logging people in:

Code: Select all

if($username != "" and $password != "")
{
	$chk_login = "select * from admin where username = '$username' and password = '$password'";
	$run_login = mysql_query($chk_login,$link);
	$recordcount = mysql_num_rows($run_login);
	
	if($recordcount == 0)
	{
		print "<font color='red'>Your username and/or password does not match our records. Please try again.</font>";
		include("login_form.php");
	&#125;
	else
	&#123;
		setcookie("sessionid", "1", "0");
		print "You have successfully logged in. We will redirect you to the menu in 2 seconds or <a href='index.php'>click here</a>.";
		print "<META HTTP-EQUIV='Refresh' Content = '2;URL=index.php'>";
	&#125;

&#125;
Now, the code works fine on linux.
The code worked fine on the previous windows server I was on, but my code got moved to another windows server that apparently has an upgraded version of PHP (i cant tell you the old version).

Since the move, my code no longer works. I mean the cookie is not stored/usable. (No, it's not my browser)

Does anyone have any idea why or how to fix this?

Thanks,

- Joe
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

search for register globals
Post Reply