Creating a signin form – applying an authentication procedure
In this recipe, we will be learning how rows can be accessed from a specific table and compared with the information supplied.
We assume that a database called ECommerce
already exists and a table called Users
also exists in the ECommerce
database. The Users
table consists of two columns, EmailAddress
and Password
. Also, we assume that the Users
table contains a few rows in it. The user will be prompted to enter their email address and password in the signin form. The Users
table is searched for the specified email address. If the email address is found in the Users
table, then the password in that row is compared with the password entered. If the two passwords match, a welcome message is displayed; otherwise, an error message indicating that the email address or password don't match is displayed.
How to do it…
Here are the steps to understand how data in a database table can be compared with data entered by the user and authenticate...