WDV341 Intro HTML

Project-6 Form Handlers - In Class Exercises

Complete the following exercises. When finished upload to your server. Update your links on your WDV341 Homework page to include this assignment. Zip your work and attach it to your Blackboard assignment and submit it to Blackboard.

Form Handler

1. Download the Form Handler example folder. Extract the contents and upload to your server. Run the form and view the results. This example uses a basic form. When the form is submitted the form action attribute will send the form data to a PHP page. The PHP page will create a confirmation page for the user. It will display the information from the form using the foreach loop process. Link to Form Handler in class Work.

2. Create a second version of exampleForm.htm called exampleForm1.htm. Modify this page so that the action attribute calls a second version of formHandler.php named formHandler1.php. Modify this new formHandler to pull all of the fields on the form using the names of the fields and the associative power of the $_POST variable. Link to New Form Handler.

3. Create a third version called exampleForm2.htm and formHandler2.php. Change the form to use the 'get' method and to call the new version of formHandler. Modify formHandler2.php to use the $_GET variable instead of the $_POST. Notice the difference in the URL on your browser. Link to Second New Form Handler.

Form Emailer

4. Download the Form Emailer example folder. Extract the contents and upload to your server. Run the form and view the results. This example uses a basic form. When the form is submitted the form action attribute will send the form data to a PHP page. The PHP page will create a confirmation page for the user. It will display the information from the form using the foreach loop process. It will then create the variables containing information to be sent via an email. It uses the PHP mail( ) function to send an email. Link to Form Emailer in class Work.

5. Create a second version of formEmailerExample.htm called formEmailerExample1.htm. Modify this page so that the action attribute calls a second version of basicFormEmailer.php named basicFormEmailer1.php. Modify this new formHandler to pull all of the fields on the form using the names of the fields and the associative power of the $_POST variable.Link to New Form Emailer.

6. Create a new version of formEmailerExample.htm called formEmailerExample2.htm. Modify this page so that the action attribute calls a new version of basicFormEmailer.php named basicFormEmailer2.php. Modify this new formHandler to use the $_GET variable instead of the $_POST variable. Notice the difference in the URL on your browser.Link to Second New Form Emailer.