In this assignment you will create a form that takes input data, send the data to a php program which will verify that fields were submitted correctly. Directions for starting this assignment can be found in my notes in the password protected folder at: http://profhicks.com/lmhLectures/forms_FormProcessing.pdf These notes walk you through the process of creating a form which will send data to your php program. See the demo assignment at: http://aeneuman.profhicks.com/form.html http://aeneuman.profhicks.com/form.html The php code, handle_form.php illustrated in the notes above simple has your program displaying the contents of form fields entered by the user. You are to extend this program by adding the following validation features:



It should end in a 2 or 3 character extension |
![]() |
It should contain an @ symbol![]() |
![]() |
If the user input all fields and a correct format email address then display the information the user entered along with a message like that in the second screen capture below:

Publish a link to your form page PHPLab4.htm, on your course home page on the profhicks.com server account space. Upload your php file handle_form.php to your server space also.
Note: When you view a php file in a browser, what you see is the html code generated by the php code. Because of this, I would like you to submit your php page in Blackboard in addition to uploading it to your profhicks server space. (Upload the handle_form.php file in Blackboard just like you submit your C++ programs in Blackboard. You do not need to upload your html page in blackboard, but of course you do need to upload both files to your profhicks web server space.)
| Task | Points | Description |
A |
5 |
Your home page has a link to the phpLab4.html page. When the submit button is pressed, your form data is sent to a php page named handle_form.php for processing. |
B |
5 |
You have uploaded your file phpLab4.php to Blackboard. |
C |
5 |
Your program validates that the user has entered some text within the name textbox field. Print a specific message when the name has not been input. |
E |
5 |
Your program validates that the user has entered some text within the email textbox field. Print a specific message when the email address has not been input. |
F |
5 |
Your program validates that the user has entered some text within the comments textbox field. Print a specific message when NO comments have been input. |
G |
5 |
If the user does NOT enter text into any of the fields AND their age is OVER 60, print an additional message about being forgetful. |
H |
5 |
Your program ensures that the email address ends in a 2 or 3 character extension preceded by a period. |
I |
5 |
Your program ensures that the email address begins with a sequence of alpha numeric character followed by a @ symbol. |
J |
10 |
If all data input correctly, your program prints out all the user information for the form fields: name, email and comments. |
50 |
Total |
[top]