Duration: 25 to 35 minutes.
In this exercise, you will use mysqli to authenticate users.
- Open Authentication/Exercises/index.php in your editor. This file has been created for you and contains the underlying logic of the authentication application. You will see that it includes several of the scripts we saw in earlier exercises. Most of these are exactly the same, but a small change has been made to the
pwEntry() function in Authentication/Exercises/Includes/fnFormPresentation.php. It now takes a fifth parameter:
$repeat is set to true (default), the user will be asked to repeat her password (used for registration forms). When
$repeat is set to false, she'll just get a single password field (used for login forms).
- Your job is to finish Authentication/Exercises/Includes/LoginForm.php and Authentication/Exercises/Includes/Login.php, which are currently both nearly empty. You may find it helpful to refer to ManagingData/Demos/Includes/EmployeeForm.php when creating LoginForm.php and to ManagingData/Demos/Includes/ProcessEmployee.php when creating Login.php.