Felitaur Site
Offerings
|
   
|
[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
- A basic html form page format
- Have a text field that asks for their first name
- A text field that asks for their age
- A set of radio buttons that asks for gender (male female
other)
- The method should be "post" and the action should be
"prog1.php"
- And the page and any output must validate to XHTML 1.0 Transitional
- Programming Requirements
- 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)
- Only print if they have entered something, but you can keep the form on the page regardless
- 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" ;)
- 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)
- 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.
- 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:
|
|