 So students in this module, we will do something very interesting, very code intensive also. We will combine the form and the form handler together and that will generate very powerful results. We will show the user what the user has entered, what they have missed. We will show it on the screen so that they fix the problem and we will pass this to the server also and we will show to the user what the system is remembering. So let's look at the outline of this module before we go ahead. So we will create an interactive form, we will test the form. The form will be submitted. If the critical values are missing, they will be showed by a red boundary. There will be an error message. If things go smoothly, there will be a thank you message and then of course about the password part of the form. So most of this module is focused on creating and generating a form. So what form I am talking about, let's take a look. So the following, all in one PHP script which is in the text does the following things. Display registration form to the user, fill it out. Certain fields are required. Displays the thanks message if everything is fine. Error messages for mandatory fields if they are missed. Remember the field fields and of course does something very interesting. Now browse the script URL in your web browser. You will see a blank registration form as you can see on the screen. Try submitting an empty form by clicking the send details over here. You should see an error message with the missing required fields highlighted. If you fill in some values and resubmit the script keeps checking to see if you fill in the required fields. If not, it re displays the form including any data you have entered and highlights the missing fields as shown in this figure. Okay, now let's look at the code. The script kicks off with the standard HTML page header. It includes an additional CSS class for the red error boxes over here. Next, the script checks to see if the form has been submitted. It does this by looking for the existence of the submit form button over here. Okay, and the script calls a process form function to handle the form data. Where is the process form over here? It calls the display form over here to display the blank form passing in an empty array. That's the area I'm talking about. Next, the script defines some helper functions, validate field over here within the form to display the red box and it's passed a field name and a list of all the required fields that were not filled. Okay, field name and missing fields. If the field name is within the list, it displays the marker for the error box over here. Now, let's look at prefilling text and checkboxes. Set value is used to pre-fill the text input fields. Set value over here. It expects to be passed a field name. It then looks up the field name in the dollar underscore post super global array and it found the outputs the field value. Set check is used to pre-select checkboxes and radio buttons by inserting a checked attribute into the element text. Similarly, set selected. So we are talking about that selected over here and set checked over here. Both function look for the supplied field name in the dollar underscore post, which I've already mentioned over here. And if the field is found and its value matches the supplied field value, the control is pre-selected. Let's move on to the next part setting up at initialization. Next comes the form handling functions process form. Process form. This sets up an array of required field names and also initializes an array to hold the required fields that weren't filled in. Now the function loops through the required field names and looks for each field name in the dollar underscore post over here. And if the field name doesn't exist or it does exist, but its values empty, the field name is added to the missing fields. Missing field is over here. The missing fields were found, the function calls the display form. Calls the display form over here. Okay. To re-display the form passing in the array of missing field names so that the display form can highlight the appropriate fields. Otherwise displays thanks over here. Now displaying the form itself. The display form function itself displays the HTML form. Display a form function over here. If this array is empty, the form is presumably being displayed for the first time. So display form shows a welcome message. This is the welcome message over here. However, if there are elements in the array, the form is being re-displayed because there were errors. So the function shows an appropriate error message over here. Next, the form itself will display the form uses the post method and its action attribute points back to the script URL. To the post message. Then each form control is created using HTML markup. Notice the validate field, set value, set check, set selected. Okay. Are called throughout the markup in order to insert appropriate attributes. And finally, finally about the password. With the password fields. Over here. Okay. And over here also type password is unwise to display a user's password in the page because the password can easily be read by the viewing the HTML source. Therefore, the two password fields. Over here also are displayed as blank, blank value, blank value. The script checks to see if the form is being re-displayed due to missing required field value. So the password field labels are highlighted with the red error boxes to remind the users to re-enter their password. So that's all I have for this module. Thank you for your time.