Assignment - Form Submission and Validation
In Assignment, a user panel was created, where users enter some registration entries as stated in the figure below:
New User! Please sign up
User Name *
|
[]
|
|
First Name
|
[]
|
|
Last Name
|
[]
|
|
Mobile
|
|
|
Email *
|
[]
|
|
Password *
|
[]
|
|
Confirm Password *
|
[]
|
|
|
|
|
The aim of this assignment is to submit the values entered by user to a (user-registration-handling.php) page for server-side processing. The objectives are:
1. Learn how to submit a form to a php page.
2. Conduct a server-side validation for form entries.
3. Write the submitted values to a text file on the server.
Requirements:
-Use the form tag to submit the fields entered by a user to (user-registration-handling.php) page.
-Read and validate the fields in this php page. You much conduct various types of validation based on the field itself.
- Validating the existence of a user name
- Validating the existence of an email
- Validating the existence of a password and password confirmation
- Validating that both the password and password confirmation inputs are identical
- Validating the format of the entered email. It should adhere the following format
If at least one field entry happens to be invalid, the user will be directed to (invalid-user-entry.php), where an error message appears indicating the error type. Also, a hyperlink appears on the same page that sends user back to the registration page.
If all entries are valid, save all user information in (user-info.txt) each entry in a separate line, i.e.,
User Name:
Last Name:
Note that the password should be encrypted before being stored. Use the md5 function for that.