HTML Forms PowerPoint PPT Presentation

presentation player overlay
1 / 7
About This Presentation
Transcript and Presenter's Notes

Title: HTML Forms


1
HTML Forms
  1. What are clients? What are servers?
  2. What is PHP? How does it resemble HTML? What is
    different from HTML?
  3. How are variables written in PHP?
  4. How do HTML forms pass variables to a PHP script?
  5. What is the difference between the GET and POST
    method for a form?

2
MSU 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
3
CSE 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
4
HTML 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?

5
Time 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

6
On 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.

7
Formatting 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?
Write a Comment
User Comments (0)
About PowerShow.com