Exercises, Questions, and Projects

  1. Enhance the inputquestions scripts by validating the input. Specifically, check that the value is a number. Do research and implement a way to validate the answer pattern for a question as being a valid regular expression. It would also be appropriate to add functions (addslashes and stripslashes for PHP, and escape and unescape for ASP/JavaScript) to handle special characters.

  2. Modify the system by adding a categories table. A possible design is for the fields to be category_id, category_name, and category_description. Questions must refer to one of the given categories.

  3. Design and add a script or scripts to edit one or more of the fields in the questions table. You can then remove the listing of all the questions from the inputquestions scripts.

  4. Enhance the showscores scripts to show when each player last played the game. This field is not used in the present implementation.

  5. The questions in the database each have a field for points. This field could be any number. Modify this field to be a level, say from 1 to 5, indicating easiest, easy, moderate, difficult, most difficult, or the words indicating level. You can investigate MySQL and Access for support of a datatype called enumerated types. Modify the inputquestions scripts to offer a radio box instead of a field for the level. Then, modify choosecategory to accept a level indication.

  6. A name submitted by a person generally is not considered distinctive enough. Develop a system in which the player name is checked against existing names, and the player asked to confirm if he or she was the player who last played on a given date and had a given score. Alternatively, design and develop an ID and password system.

Creating Database Web Applications with PHP and ASP
Creating Database Web Applications with PHP and ASP (Charles River Media Internet & Web Design)
ISBN: 1584502649
EAN: 2147483647
Year: 2005
Pages: 125
Authors: Jeanine Meyer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net