logo © 1996 Phil Waclawski
Felitaur Site
Offerings
About Me
Crafts
Services
ftp files
Help Files
What's New?
Home Page
Other Links
Anatomy &
Physiology
Arthropods
Biology
Computers
Ferrets
Fun Links
Internet
Linux
S.C.A.
Win 95/NT
Comments or
Suggestions
webmaster@ felitaur.com
   
[Webscripting Homepage] | [Javascript Homepage] | [Perl/CGI HomePage] | [PHP Homepage]
PHP Program Assignment 1
For your first programming assignment, you will create one file. prog1.php and it should be linked clearly on your index.html page.
  • HTML requirements
    1. A basic html form page format
    2. Have a text field that asks for their first name
    3. A text field that asks for their age
    4. A set of radio buttons that asks for gender (male female other)
    5. The method should be "post" and the action should be "prog1.php"
    6. And the page and any output must validate to XHTML 1.0 Transitional
  • Programming Requirements
    1. As it is slightly safer, use the $_POST['namefromform'] type format to grab your responses from the form (note: as a reminder, namefromform is whatever you used in the name="  " attributes in the form)
    2. Only print if they have entered something, but you can keep the form on the page regardless
    3. Print back the name in a "Hello $name" format, but, if it is YOUR first name, have a different greeting. In my case, if the name matched "Phil" I'd say, "Wow, Phil is such a cool name" ;)
    4. Take their age, and print (using a loop, probably while()) out a countdown to their age. (If they are 10, you should see it print 1 2 3 4 5 6 7 8 9 10)
    5. Use a switch statement for the gender, and if they are male, print out a link to http://www.geek.com, if female print out a link to http://www.geekgirl.com/, and if they choose "other" have it print out both.
    6. Use trim() and strlen to partially decontaminate the user input
  • Print the date at the bottom of the page in the format Saturday, January 28, 2006

This page last updated on: