|
home—lects—exams—hws
breeze (snow day)
Due: 2011.Mar.18 (Fri)19 (Sat)1 23:59
(but note that the project proposal will be due that same weekend,
so start well in advance)
You will continue building a course catalog system from hw01—Input validation. This time you will submit your files on WebCT as well as having
(40%) Make your course-entry form sticky: if the submitted form doesn't validate on the server side, the user is presented with the page containing all the info already filled (without needing to use their browser's “back” button).
If the form has no errors, then it will display the results similarly to hw01. (My solution has four php files just for the form: one for (generating) the javascript validation functions; one for generating the form itself; and one for the successful result page; one master file to rule them all.)
(10%) Re-factor javascript from hw01. You may want to put some javascript functions in their own file of code you might use on other web projects (as done with the code shown in lecture for auto-generating “show just one section” from (the children of) a parent element, hiding-parts.js).
For example, adding a new concentration to a major should require minimal updates (perhaps: adding one checkbox+text, one line to javascript validation, and one line to php validation). (Extra-credit if it only requires one change in all your files.)
The points for this are awarded for not having (say) four copies of the same javascript/php code for each concentration, but instead just the code just once (in a function called from a loop, say).
Require that users log in, authenticating with their RU login
3;
their session will time out after 5min of inactivity.
Further info:
You'll ask for a username and a password.
You don't need to actually authenticate anything;
any username/password will work for now.
(In hw03 you'll look up user names in a database, to authenticate).
However, until they have logged in,
they should not be able to enter course information.
(You can do anything reasonable if they are not logged in:
either have a note at the top of the page stating that
they must log in before completing the form,
or flat-out redirect them to the login page.)
If a user is not logged in (or perhaps their session has timed out), the response form should include a statement to that effect.
Provide a logout page, to end their session (before 5min expires).
You may integrate bits from the hw01-soln/ into your code, but be sure to understand how any code that you use works.
Each file should start (after a doctype declaration) with a PHP comment
with your name and a summary description of what the php code accomplishes.
Use meaningful variable names, function names, and good comments as needed.
Javascript code should be described with inside
(“
2 Some extra credit if your crs-cat-sources.php actually loops over all appropriately-named files in its directory. ↩
3 If you like, you may use the RU authentification as described at tutorial.php. ↩
home—lects—exams—hws
breeze (snow day)
©2011, Ian Barland, Radford University Last modified 2011.Apr.10 (Sun) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |