|
home—lects—exams—hws
D2L—breeze (snow day)
You are working for Lizard Entertainment, makers of the popular adventure game, .World of Wowcraft (“.W.o.W.”). In .W.o.W., players choose a type of character: either warrior, mage, priest, or rogue. Over the course of the game, their characters can learn various skills, depending on type: For example, the diplomacy skill (which is learnable only by rogues and priests), or the acrobatics skill (which is learnable only by rogues and warriors), etc.. Each skill is be tied to one of six built-in character traits: Strength, Intelligence, Wisdom, Dexterity, Constitution, and Charisma. Finally, each skill has a minimum-level (between 30 and 100 inclusive).
Your boss decides that a key feature of the game is that people can add their own skills to the game. Your job is to build a web-page that lets people enter new skills for the game to use. People will enter the name of the skill, a detailed description, which character-types can use it, what trait it's tied to, and their own name (to get the glory). When they submit their form, they will see a response page summarizing the information they entered.
An example of filling out the form | The result of the processing the form |
For this homework, you will take your hw03 solution (copied to a directory hw04), and modify it as follows:
Have your form actually submit to skill-handle.php, and generate a response similar to the one pictured above.
When printing values taken from the form, sanitize the HTML. A user should be able to enter (say) a description which includes characters like < and ' and newlines, and the resulting summary should
Note that the checkboxes in skill-form.php should all have the same name attribute (and it should end in “[]”), so that you can retrieve it as an array in your form.
Your file
The page does need to contain (near the top) your name, a link to your skill-form, a link to this homework-assignment, and a “table of contents” — a list of links to later in the page, with the detailed information for each file.
The source should be shown only if the current time is between 2013-Mar-06 23:59 and 2013-May-31 23:59; otherwise show a message along of the lines of “source code only available between 2013-Mar-06 23:59 and 2013-May-31 23:59.”
Use the function
Optional:
A
You can replace characters in a string by calling
A function
A function
No test cases required — this function prints, and does not return anything.
A function
No test cases required — this function prints, and does not return anything.
As usual, I will visit the URL https://php.radford.edu/~yourUserName/itec325/hw04/index.php to grade your work. If that URL is not accessible, you will get a 0 for that portion of the grading!
Please run/check your program/html incrementally — don't write huge amounts of the assignment w/o even running it.
1It's a bit dangerous to normalize all quotes to a single type, since it means your test cases won't catch mis-matched quote-types. ↩
2In regular
expressions including unicode “
3the function to show-source a file is one of the few exceptions ↩
home—lects—exams—hws
D2L—breeze (snow day)
©2012, Ian Barland, Radford University Last modified 2013.Mar.26 (Tue) |
Please mail any suggestions (incl. typos, broken links) to ibarlandradford.edu |