|
home—lects—hws
D2L—breeze (snow day)
due Feb.14 (Tue) in class (for 15% extra-credit),
or Feb.15 (Wed) 23:59 (no extra credit)
Submit on D2L only (no hard-copy)
Deliverable:
Your form must be viewable on-line at
https://php.radford.edu/~yourUserID/itec325/hw03/okaymon-form.php.
Submit hardcopy of
utils.php, utils-test.php,
the form, the form-handler (named “okaymon-handle.php”),
and at least three “okaymon-handle-sampletest-N.php” files.
On D2L submit all your files (as individual files, not a .tar).
Bring hardcopy to the class following the deadline.
You have been hired to help develop the game Okaymon -- a crowdsourced game of evolving monsters! You need to develop a web form with the information below; when the form is submitted, the user is shown a page which simply re-caps the submitted information.
In this homework, we will (A) add more utility helper-functions for producing html to utils.php, and then (B) write a form with a simple form-handler which just displays the information received by the form.
Write the following functions in php:
Include an additional, optional input,
of type boolean-or-string:
A
In class, we wrote part of
We will want the all the inputs to get grouped together into a single array,
contained inside
$_POST["food-tastes"] === array( "Snickers" => "yummy", "Bananas" => "meh", … ) $_POST["food-tastes"]["Snickers"] === "yummy" |
Using name-attributes with square-brackets,
The results from each row should be grouped together in an array, in
Make a form (10pts) and a form-handler (10pts) for entering new species of Okaymon
(not an individual Okaymon),
including tests — see “handle-sampletest” below.
Your forms don't need to look exactly like the above1, but should have the same information (and look respectable).
Of course, you should call functions from part (a) appropriately, and write any additional functions (and tests) as appropriate.
home—lects—hws
D2L—breeze (snow day)
©2017, Ian Barland, Radford University Last modified 2017.Feb.14 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |