Question: **PHP** Create a User Authentication page using the filename logon.php in a folder. I have attached the credentials.db file to test against the page. Please

**PHP** Create a User Authentication page using the filename logon.php in a folder. I have attached the credentials.db file to test against the page. Please submit a php file.

o The logon.php page consists of three (3) functions: authenticateUser($username, $password) displayLoginForm($message="") processPageRequest()

o The first statement on the page must be processPageRequest(); // Call the processPageRequest() function

authenticateUser($username, $password) function o Test whether the user entered valid login credentials Read the data values from the credentials.db file The data values include the username, password, display name, and email address The data values are separated by commas Convert the data values obtained from the credentials.db file into an array containing the four (4) values Compare the username and password values obtained from the credentials.db file to the values stored in the $username and $password variables If the strings match, Create a session Store the display name and email address values obtained from the credentials.db file in the session Redirect the browser to the index.php page If the strings do not match, Create an appropriate error message Call the displayLoginForm($message="") function Pass the error message

displayLoginForm($message="") function o Display the login form using the appropriate HTML statements Give the page a descriptive title Display myMovies Xpress! in some fashion (header text, picture, etc.) near the top of the page Provide directions to the user (in plain text) Create a form that includes the following controls: Note: Use the form tag

. One (1) text field configured as required

Username One (1) password field configured as required Password Two (2) buttons

Clear This button should reset the form fields Login This button should submit the form

processPageRequest() function o Test whether any $_POST data was passed to the page Clear all session variables If $_POST data does not exist, call the displayLoginForm() function If $_POST data does exist, call the authenticateUser($username, $password) function Pass the appropriate values provided in the $_POST data

**PHP** Create a User Authentication page using the filename logon.php in a

This is the only line that should be in the credentials.db file: jdoe,1234,John Doe,j.doe@gmail.com This is the only line that should be in the credentials.db file: jdoe,1234,John Doe,j.doe@gmail.com

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!