1. Write (or steal from Mother Goose, etc.) a short story or fairy tale (100-200 words). [Example MadLib link - click here to see the php source.]
2. Choose at least 10 words to remove from the story in MadLib fashion (adjectives, verbs, nouns, exclamations, adverbs). Make one a number. Make one a conditional (yes/no, true/false, happy/sad).
3. Create an HTML form asking the user for the types of words deleted from the story (Enter an adverb:, etc.). Create a dropdown combo box for the number question (with sensible values) and either a checkbox or a radio button set for the conditional response.
4. Mark up the story in PHP to insert the supplied form answers into the MadLib story. For the conditional response, change the sentence or phrase output dependent upon the value provided. For the number, perform some kind of mathematical calculation using the number.
5. Set the action of the HTML form to the name of the PHP file. Test with varying responses (and debug).
6. Include some graphic design to go along with your story (colors, images, etc.).
[Option: Combine the HTML and PHP into one file for a "redux" form - test to see if a form variable is set, if not: show the form, if so: show the resulting story. Another option is to allow an image file to be uploaded. Again, CSS is an option.]
©2005 - Bryson R. Payne, Ph.D. - All rights reserved.