Page 1 of 1

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

Posted: Mon Nov 08, 2004 5:04 pm
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

Posted: Mon Nov 08, 2004 5:43 pm
by timvw
search for register globals