RU beehive logo ITEC dept promo banner
ITEC 325
2011spring
ibarland

homelectsexamshws
breeze (snow day)

hw01
Input validation

Due: 2011.Feb.05 (Sat) 12:00 noon: prototype: no input validation needed; html formatting/display doesn't need to be finalized.
Due: 2011.Feb.14 (Mon) 10:00: final version

You will build two PHP pages, crs-cat-entry.php and crs-cat-resp.php. The PHP documents must be present in your RU account with permissions set so I can access them at https://php.radford.edu/~userid/itec325/hw01/crs-cat-entry.php. They must also use the show_source function so I can view your code as I review the output from your PHP scripts; this should be the last item before closing the html body:

<html>
  
  <body>
    

    <h2>Source Code</h2>
    <?php
      ini_set('date.timezone','America/New_York');
      echo "Last modified: ", date("Y.M.d (D) H:i.", filemtime(__FILE__)), "<br />\n";
      show_source(__FILE__);
    ?>
  <body>
<html>

Make sure you review the requirements list at the bottom of this document. The first script (~/itec325/hw01/crs-cat-entry.php) should display a form that allows the client to input information about a course that is required for one of the majors in the ITEC department. The most significant requirement in this form is the validation requirements.

You must validate both client-side before submitting, and server-side in the receiving script.

An example of filling out crscat-entry.php

The receiving script should be named crs-cat-resp.php in the same directory. It receives the data from the input form and displays it as shown below. Note that the course title and course number are displayed in all caps2. There should be distinct sections with borders. The Majors and associated areas of concentration should be displayed in a list similar to the figure below.

The result of submitting crs-cat-entry.php

Your pages don't need to look identical to the above images, but should look well-organized, typo-free, etc.

Guidelines

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 (“<!-- -->”) comments. Write functions (both php and javascript) as appropriate, to avoid repeated code. All code/html should be well formatted with appropriate white space and indentation so it is easy to read. Strive to minimize lines that wrap. Use standard XHTML tags and make sure your javascript does not use browser-specific constructs. Use document level css for all formatting. If you have any questions, use the discussion board. These requirements apply to both the prototype and the final version, though of course the prototype can omit much. Do not modify your final submission after the due-date.


1 The half-open interval means that 100 is included in the range, but 600 is not.      

2Um, your page won't actually have the literal note about the all-caps, though.      

homelectsexamshws
breeze (snow day)


©2011, Ian Barland, Radford University
Last modified 2011.Mar.04 (Fri)
Please mail any suggestions
(incl. typos, broken links)
to iba�rlandrad�ford.edu
Powered by PLT Scheme