PHP Member Login code, verification through, jump page after the value of the cookie can not be obtained.
Tracking code, user login verification through, and then jump to the first page, in the first page and there is a code to verify whether the user is logged in (the cookie has the user name), the result cookie has been empty, the local test is normal. The server is IIS, and the locally tested server is Apache.
The relevant code is as follows:
PHP Code
...... Slightly
index.php page Code:
PHP Code
...... Slightly
This is the code for the checklogin.php page:
PHP Code
The site does not have cross-domain issues and is under the same site.
------Solution--------------------
PHP code
setcookie ("House_havelogin", "true", Time () + 36000); Setcookie ("House_username", $row [' House_username '], time () + 36000);p rint_r ($_cookie); Header ("Location:index.php"); echo "";
------Solution--------------------
Above if you do not judge the direct Print_f ($_cookie), see what results or use the Firecookie plugin to see if the COOKIE has no value
----- -Solution--------------------
1 Comment out header ("Location:index.php");
2 in header ("Location:index.php"), add Print_r ($row) below, confirm that there is user information
3 add echo $_cookie[' House_ in index.php Username ']; Verify that the cookie has a value
PHP.ini need to set
Output_buffering = on
The program itself still has problems, if the login is OK, So anyone who can write a username and password will be able to log in.
recommends querying SQL Plus username and password 2 fields for query