Login function (1)
There may be more than one administrator in the backend, so the backend needs to have a login function for the administrator to log in. Of course, the front-end page is also needed. If we learn the back-end login, the front-end login function will be available.
First of all, we need to know what the usual login page contains. Username, password, and verification code are necessary. A few websites may have others. We only study most cases. .
The login HTML page is available in our background template, so we don’t need to write it ourselves. We only need to manually change the content.
But our first task is not to write the login function, but to create a new database and save the user name and password in the database for use when logging in.
There are two ways to create a new database, one is to use our database creation statement, just write the database creation statement in the command box, the other is to open the database and create it directly:
Login database page
Click the database in the navigation bar above to create a database and name it joke. I believe that after a long period of study, everyone can successfully build a database.
Create another data table, named login, to store usernames and passwords. There are three fields in the database, namely id, username, and password.
Add two sets of data to the database for functional testing.
Okay, the creation of our database is complete here. If the fields that appear later are not in our database, they can be modified.
The next step is to explain our login function.