|
due Feb.21 (Thu!) in class
but accepted through Feb.21 24:00, due to power-failure; bring hardcopy to next class
Submit on D2L, and hardcopy
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-test-N.php” files. On D2L submit all your files (as individual files, not a .tar).
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:
Then, modify your function to
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" |
Hint: For full credit, call one of your functions from theprevious homework solution , as a helper!
Extra credit: (2pts) Include a parameter for naming the entire table, used to group the results. Grouping the entire table's inputs into a single array is certainly the proper data-representation; the actual lecture-notes on how to do this are on the schedule for the lecture before this hw is due: grouping web-inputs into arrays.
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-test” 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.
Unlike
our first version of
silly-page.php,
your form and form-handler can use the implicit php
This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |