Urgent! Sessionquestion rewriterule {index.html & amp; fun = 000 $ & nbsp; gyjw/check. php overwrites the url my login page & lt ;? Phpsession_start (); // use session to store user information if (isset ($ _ POST ["u urgent! Session problems
RewriteRule into index.html & fun = 000 $ gyjw/check. php rewrite the url
My login page
Session_start (); // use session to store user information
If (isset ($ _ POST ["username"])
{
$ Ss_user_id = "";
// Use the User-tired IsValid () method to determine whether the entered User name and password are correct
Require_once ("user/UserClass. php ");
$ User = new User ();
// If it is correct, go to the system homepage
If ($ user-> IsValid ($ _ POST ["username"], $ _ POST ["password"], $ ss_user_id ))
{
$ _ SESSION ["ss_user_id"] = $ ss_user_id;
Echo"
";
Echo "location='index.html ';";
Echo "script";
}
// If not, go to the login page
Else
{
Echo"
";
Echo "alert ('incorrect user name or password ');";
Echo "script";
}
}
?>
Home page php
Include 'http: // localhost/gyjw/index.html & fun = 000 ';
?>
// Omit the html part
Check. php
If (! Isset ($ _ SESSION ['SS _ user_id '])
{
Echo"
";
Echo "alert ('your user does not have permission to perform this operation! ');";
Echo "top.location+'login.html ';";
Echo "script";
Exit;
}
?>
The problem is that when you log on to the home page, you first jump to check. php, which directly shows that 'your users are not authorized to perform this operation! ', Indicating that $ _ SESSION ['SS _ user_id'] does not exist. Then, if you modify the php
include ("check.php");
?>The $ _ SESSION ['SS _ user_id '] normally displays the homepage content.
Please help us! Session url php shared:
------ Solution --------------------
Check. php missing session_start ();