PHP develops simple book background management system administrator login function
The database table admin was created earlier. Here we need to add a test data of user name and password.
Judge the user name, password and verification code respectively.
Then query it through SQL statement database information matches.
If the login information entered does not match the login information we added to the database, administrator login will not be possible.
Here the data is obtained through POST.
$_SESSION["auth"]) { echo ""; ?> alert('登陆成功!');window.location='admin_index.php'"; } else { echo ""; ?>
session variables are used to store information about the user session (session), or to change the settings of the user session (session).
The correct way to store and retrieve session variables is to use the PHP $_SESSION variable to match the entered login information with the information stored in the session. If the match is successful, the login is completed.