Overview and Preparation
This is a small assignment to get your site set up for form processing. All you have to do is to add code to your index page so that there is a simple login form between the heading and the first paragraph:
When the user submits the form by clicking the “Login” button, another page should display that has “Thank you for logging in.” as its h1 element.
The Assignment
-
Prepare the form
The form must meet the following requirements:
- It must use the “get” method.
- The action must reference a file named process_form.php in your site’s scripts directory.
- All the elements in the form must be enclosed in a fieldset, which must have a legend that says “login.”
- The words “Username” and “Passwords” must be label elements for the two input elements shown, the first of which must be of type “text” and the second of which must be of type “password.’
- The “Login” button may be either a button or an input element, as you prefer.
- Make the form look “nice” using only CSS. No table elements allowed.
Work on the form until you are satisifed with its appearance and there are no XHTML or CSS validation errors or warnings.
You are allowed to use vendor-specific CSS3 properties for styling your form, even though they will cause CSS validation errors. For example, the following code would be allowed:
fieldset { -webkit-border-radius:1em; -moz-border-radius:1em; border-radius:1em; } -
Implement the PHP program for processing the form.
Duplicate the template.xhtml file for the course, and move the copy to your scripts folder. Rename it to process_form.php.
Edit the PHP file so that the content consists only of an h1 element that says, “Thank you for logging in.” Change the title element to something meaningful.
Click the “Login” button on your index page, and verify that (a) the process_form.php script loads correctly and (b) that the process_form page has the correct MIME type.
Submit
When you are sure your program does everything correctly, and that there are no errors are warnings from the XHTML and CSS validators, nor from Firebug, just send me an email message, and I’ll check it out in the usual way.
Send your email message to me at: vickeryatbabbage.cs.qc.cuny.edu by midnight of the due date.
The Subject line of your email message must be: “CS-90.3 Assignment 7.”
Don’t forget to put your name in your email message!