|
Due
19 (Wed.)
by the start of class.
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.
Then, modify your function to include an additional, optional input, of type boolean-or-string: A true indicates to include “select one” as the first entry in the drop-down; it wouldn't correspond to a meaningful choice. Providing a string is similar, except that instead of the words “select one”, use the provided string. Finally, false indicates to not include any such item. The default value should be true, if it's not explicitly passed in.
Make the form and form-handler as shown, but without the table of radio-buttons,
for now.
Name your files okaymon-form.php and okaymon-handle.php.
Your forms don't need to look exactly like the above1,
but should have the same information
(and look respectable).
We will want the all the inputs to get grouped together into a single array, contained inside $_POST. For example, if a radio table lets you enter information about whether fifty different foods are yucky, meh, or yummy, we'd want something like
$_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 $_POST.
This assignment is spread across several files: utils.php, utils-test.php, the form okaymon.php, the form-handler okaymon-handle.php, and (for part (B)) at least three “okaymon-handle-test-N.php” files and a constants-file defining the array of energy-types.
For part (A) just submit the required files to D2L; for part (B) both submit on D2L and bring hardcopy to class.
Your form must be viewable on-line at https://itec-php01.radford.edu/~yourUserID/itec325/hw03/okaymon-form.php.
This page licensed CC-BY 4.0 Ian Barland Page last generated | Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |