\n"); } else { header("Content-type: text/html; charset=utf-8"); } ?> CS 90.3 Assignment 4

Description

Create a form and make the form data database safe.

Procedure

  1. Set up the assignment.

    Create a directory named Assignment_04 under your My Website directory, and in it create a web page named index.xhtml. Create a second file named form_processor.php in the same directory. Both files must be based on the XHTML template file I am providing; both files must validate with no warnings or errors both for XHTML 1.1 strict and CSS 2.1. Both pages must be rendered in Standards Compliant mode and must be delivered as application/xhtml+xml to those browsers that will accept that content type; otherwise, it must be delivered as text/html.

  2. Do the assignment

    Code index.xhtml so that it presents the user with a nicely-formatted form for entering the user’s name, contact information (including an email address), a selection (anything but the user’s state), and a textarea for comments. Use form_processor.php as the action property. You may use the GET method during development, but the submitted assignment must use the POST method.

    Both files must use external stylesheets located in a subdirectory named css; all JavaScript must be in a file named assignment_04.js, located in a subdirectory named scripts. Put these subdirectories directly under your My Website if they are not already there.

    Do not use any tables in either of the web pages

    Use the textbook’s Core object for JavaScript event handling.

    When the user submits the form, use a regular expression to verify that the email address is valid and that all the form values have been filled in. Do not let the form submit unless it passes these verification checks.

    When the form is actually submitted, you must verify again that all the values have been filled in and that the email address is valid. Generate an output page that shows the information the user entered into the form. It must look exactly like what the user typed. But it must be SQL injection-proof.

Check Your Work And Submit The Assignment

Test your project on various browsers. Because of browser differences, it is time-consuming to get the project to work exactly right on all browser/computers, so the only requirement is that you provide a working version for Firefox running on Windows. (I will be checking your project using Firefox on a Macintosh, but that shouldn’t make a difference.) But check your code on the other browsers available in the lab: Internet Explorer, Opera, and Safari. Your code should be functional on all platforms, just not necessarily perfect.

Perform a link check on your site. If necessary, go to the Manage Sites panel and be sure you have selected the “case-sensitive link checking” option. Then right-click on your Assignment_03 directory and select the Check Links->Selected Files menu item from the context menu. Fix any errors you find there.

If necessary, copy your site from your development system to the lab as described above, and do a final check of your project using the ~<accountname> form of URL. Then send email to me telling me the project is ready for me to grade. I will copy the project from your account in the lab to babbage for testing.

The Subject line of your email must say, CS-90.3 Assignment 4, just like that, in order to get through my spam filters. Within a day, you should receive an “OK, I’ll check it out!” message from me acknowledging that I received your email.