Web Programming
Web Programming
If the HTML file links to p1b.css then it should appear like this in Firefox 42.0 on Windows 10 ("Version
B"):
Here are some additional details and requirements for this problem:
The content should be described in a single HTML file, using a <table> element to display the
main table.
There may not be any formatting information in the HTML file other than class and id attributes.
The appearance must be generated entirely with CSS style information; you may not use images
or Javascript for this problem.
1
The only change that should be required to switch from Version A to Version B is to change the
<link> element in the header to refer to a different CSS file.
Your CSS files must appear in a directory called styles.
Try to duplicate the appearance in the images above exactly ("pixel perfect"). For example:
o Some of the columns should be centered whereas others are left-justified.
o The "Total" line appears only in Version B (hint: you may find the display attribute useful
in producing this effect).
o The title in the browser title bar should read "CS 2190 Project 3, Problem 1".
o Both versions use the Tahoma font in a 13-pixel size.
o When the mouse moves over an email address, the text color should change to #cc6600.
o The background color for the header row in Version A is #687290.
o The background colors for the body rows in Version A are #eeeff4 and #dfe1e8.
o The white lines between rows in Version A are 1 pixel wide.
o The color for the frame around Version B is #d0d0ff.
o The frame in Version B is 10 pixels wide; there are 20 pixels of empty space on either
side of the frame.
o The horizontal rule above the "Total" line in Version B is 2 pixels wide.
o Match the paddings and spacings as closely as possible.
Your HTML file must be a valid XHTML document that passes validation at
http://validator.w3.org, and your CSS files must pass validation at
http://jigsaw.w3.org/css-validator/
Note: the border and margin styles are not supported for <tr> elements; <td> elements support
border but not margin.
Text widgets to collect the first name, last name, constituency, email, years of service,
password, and password confirmation.
You should also include a hidden field with the value 6eb6ac241942dc7226aeb
When the Submit button the form is clicked, a JavaScript validation function must be run. This
function should ensure that
1. None of the fields listed above is empty.
2. The email address contains at least one letter to the left of the @ symbol, at least one
character immediately after the @ symbol, then a period, and then at least one
character after the period. The following regular expression may prove useful as you
write this function: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i.
3. Years of service is a number between 0 and 50.
4. The values of Password and Password confirmation match.
The title in the browser title bar should read MP creation form
The form should use the Tahoma font in a 13-pixel size.
2
If an error is detected in a field during validation, that field should be colored in red.
Your HTML file must be a valid XHTML document that passes validation at
http://validator.w3.org, and your CSS files must pass validation at
http://jigsaw.w3.org/css-validator/
attacker would need to recompute all of the dictionary digests for every distinct account in the
database. This makes dictionary attacks more expensive.
After each new and valid MP is submitted, print the contents of the database to a table that is formatted
as in Problem 1-a. The database for this problem should be named MPMgmtDB. Use the database
username comp2190SA with the password 2015Sem1. The MPMgmtDB should contain a table
called Representatives. The fields of the table are as follows:
Field
first_name
last_name
Constituency
Email
Yrs_service
Password_Digest
Salt
ID
Data type
String
String
String
String
Integer
String
String
Integer, autonumber
What to turn in
1. You will hand in all of your XHTML, CSS, Javascript, and PHP files. All of your CSS files must
appear in a directory called styles, your Javascript files in a directory called scripts.
2. A separate (typed) document of a page or so, describing the overall program design for Problem
3, a verbal description of how it works, and design tradeoffs considered and made. Also
describe possible improvements and extensions to your program (and sketch how they might
be made).
3. A separate description of the tests you ran on your program to convince yourself that it is
indeed correct. Also describe any cases for which your program is known not to work correctly.
Grading
Acknowledgements
The text on salting and hashing is based on some text developed by John Ousterhout for his CS142
course.