RU beehive logo ITEC dept promo banner
ITEC 325
2014fall
ibarland

homelectshws
D2Lbreeze (snow day)

hw04
Server-side validation

Due: 2014.Oct.18 (Sat) 23:59

We will incrementally improve on hw03—sanitized html: and automated source-listings's .W.o.W. page by adding server-side validation.

As in previous homeworks, your page at https://php.radford.edu/~yourUserId/itec325/hw034/index.php should have a link to your skill-entry form near the top, and include a list all your files (with links), and should also display their source (between Oct.20 and Dec.22). See hw03-soln/ for an example. Presumably, you will want to copy your hw03 directory to a new hw04 (cp -r ).

Server-side validation

As before, after submitting the skill-form will lead to a page printing the entered information. However, the page's title (and, its heading) should be something like “skill submitted” (as before) or “Skill form contained n errors”, as appropriate. Then, if there were errors, give a list of the error-messages, before printing the entered information as before. (In particular, we are not (yet) sending them back to the form, on a failed-submit; that's next hw.)

What to validate

When considering any text input, trim leading/trailing whitespace, and collapse multiple (interior) horizontal-space into a single space-character. (Use the unicode property \p{Z} and preg_replace.) After that, the following properties should hold (and you should report a validation-error-message if they don't):

Structure of code


Other requirements

These apply to all homeworks for this class:

1She probably goes by “Kimmy-Jo M.R.”, but still…      

2 I recommend an array of max-lengths, which map the name-attribute to the length: array( 'skillName' => 80, ).      

3Remember that a good CSS style-name describes the meaning (semantics) of the style, not the particular styling it creates: something like “menu-item” or “telephone-number”, or “default-entry”, and not “centered” or “bold-sans-serif” or “blue-italics”. Here is further discussion.      

homelectshws
D2Lbreeze (snow day)


©2014, Ian Barland, Radford University
Last modified 2014.Oct.14 (Tue)
Please mail any suggestions
(incl. typos, broken links)
to ibarlandradford.edu
Rendered by Racket.