Title: HTML Forms
1HTML Forms
- What are clients? What are servers?
- What is PHP? How does it resemble HTML? What is
different from HTML? - How are variables written in PHP?
- How do HTML forms pass variables to a PHP script?
- What is the difference between the GET and POST
method for a form?
2MSU Web Pages are Files in AFS
Any person on the Web can browse
to http//www.msu.edu/sparty/day06.html
MSU Web Server www.msu.edu
User SPARTYs Web Page in AFS u\msu\user\s\p\spa
rty\web\day06.html
3CSE 103 PHP Scripts are Files in AFS
Any person on the Web can browse
to http//cse103.egr.msu.edu/afs/msu/user/s/p/spa
rty/ web/form_handler.php
CSE 103 Web Server with PHP cse103.egr.msu.edu
User SPARTYs Web Page in AFS u\msu\user\s\p\spa
rty\web\ form_handler.php
4HTML Forms and PHP
- What tag is makes a text field in a form?
- What tag is makes the button to submit a form?
- How does the form specify the location of the PHP
page used to process the data submitted by the
user? - How does PHP refer to the values that were
entered by the user into a form field? - What command is used to print out the value of a
form field in a PHP script? - What parts of the PHP source do not appear as
part of the HTML output of the PHP page?
5Time Stamping a Page
- Use PHP functions to put a time stamp on your
page - time() returns the current time (in UNIX format)
- date() write the time in a human readable format
- The manual pages for these functions can be
reached from the Classwork page for today - Display the timestamp in the form
- Monday, March 22, 2002 123pm
6On which day of the week were you born
- Modify the form
- Add boxes to find out the month, day, and year
that the user was born on - Modify the script
- Use the information about the date obtained from
the form and the mktime() function to display the
day of the week on which the user was born.
7Formatting forms with tables
- Which tag is used to specify the start of the
table? - Which tag is used to specify a row?
- Which tag is used to specify a column?
- How do you specify how much of the window the
table should take up horizontally? - Where are the contents of the table cells?