Exercises, Questions, and Projects

  1. Define and describe the following terms: server-side, delimiters, objects, methods, collections, and arrays.

  2. Go online and find sources for ASP, PHP, and JavaScript. These sources can complement your reading of this text.

  3. Describe the role of the following HTML constructs: the action attribute in a form tag, a type of hidden in an input tag, a type of submit in an input tag, a type of reset in an input tag, method equal “get” versus method equal “put” in a form tag.

  4. What do the following ASP/JavaScript constructs do (what is the PHP counterpart)? Request.Querystring, Response.Write, + (the plus sign), <%…%>.

  5. What do the following PHP constructs do (what is the ASP/JavaScript counterpart)? echo, . (period or dot), <?php … ?>, print.

  6. Using JavaScript, assuming a variable named cost holds the price of an item, and assuming a variable named discount holds either ‘yes’or ‘no’, write the code that resets (use an assignment statement) cost to 85% of its current value if the discount variable is equal to ‘yes’.

  7. Write the PHP version of the previous problem (hint: pay attention to the names of the variables).

  8. Create your own fact guessing game. You would use the same structure as the state capitals, but insert different paired facts in the two arrays and different prompting messages.

  9. Add a third type of question to the state/capital games; specifically, use the shape of each state. You need to locate images representing the shape of the states, without the name of the state or any city. The answer to a shape question would be the state name. You will need to create a third array with element values the names of the image files, or you can dynamically construct the names of files using the state name concatenated with “.gif” if indeed the files are all of type .gif. Otherwise, use whatever the file type is. Remember, you can put any HTML within the <form…> and </form> tags.

  10. Create a “number facts” game. Use the random feature to select two integers, and ask the player to add or multiply. The handler program will perform this same operation and compare to what the player has entered.

  11. Add scoring keeping to the state/capitals or another game. This would be a task for cookies, which will be described later, but you can simulate the function of cookies by passing along as a hidden variable the score.

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

Similar book on Amazon

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