WDV101 Intro HTML and CSS

UNIT 3 Forms - Lesson 2 Server Side Processes

This page will demonstrate how a server side application will take the data that was entered on a form and display it within an HTML table. This example will work for any form. It is setup to read any or all fields on a form without needing any changes. Other applications are more specific to the form they process and require updates anytime the form is changed.

Instructions

  1. Place the file name 'demonstrateFormHandler.php' in the action attribute of your form. This is using the default pathname and will look for this file in the same location as the form.html page. You may place server side processes in their own folder on the server. It is common to use a folder called 'files' which contains server side processes. In that case you would include the pathname in your action attribute. Example: action='files/demonstrateFormHandler.php'
  2. Move your form.html page AND this page to your host server.
  3. Use your browser to locate and run the form.html page on your host server.
  4. Complete the form and click Submit.

The table below displays the 'name=value' pairs that were entered on the form and processed on the server. This page is a result of that server side process.

The Field Name column contains the value of the name attribute for each field on the form. Example: <input name="first_name"> This displays what you coded into the HTML. NOTE: If you do not have a name attribute for a field OR if the name attribute does not have a value the form will NOT send the data to the server.

The Value of Field column contains the value of each field that was sent to the server by the form. This will vary depending upon the HTML form element and how the value attribute was used for a field.

Form Name-Value Pairs

Field NameValue of Field