The login processing code is incorrect. I don't know how to solve it! The database connection file of this code is okay, and the database can be connected normally! However, no matter how I log on, the logon page is displayed, and the list. php page is not displayed! There is no way to solve this problem!
Session_start ();
If (isset ($ _ POST ['uid']) & isset ($ _ POST ['password'])
{
$ Userid = $ _ POST ['uid'];
$ Password = $ _ POST ['password'];
Include ("conn. php"); // Database Connection file
$ Query = 'select * FROM users'. "where userid = '$ userid'". "and password =' $ password '";
$ Result = mysql_query ($ query );
If ($ result ){
$ _ SESSION ['who _ user'] = $ userid;
}
}
?>
Include ("tou. inc ");
?>
If (isset ($ _ SESSION ['who _ user'])
{
Header ("Location: list. php"); // The user page to jump to after determining the identity
} Else {
// No logon
?>
- ID:
- Password:
Register an ID
}
?>
Reply to discussion (solution)
<From method = "POST" action = "start. php">
The form is wrong. can I submit the form?