PROCESSING FORMS
<form action =
"http://www.bigbadbrain.com/webform1.aspx" method =
"post"></form>
-
The action attribute specifies how to process the form data
-
Generally a script file such as CGI or ASP
-
The method attributes determines how form data is
submitted to server
-
get
appends user input to the URL
-
post passes user information in the body of http request
Example
SIMPLE AND CRUDE METHOD FOR EMAILING FORM DATA
<form action = "MAILTO: abc@xyz.orc"
method = "post" enctype="text/plain"></form>
EXAMPLE
PRACTICE
Create a page for submitting comments. Your page should submit your name,
password and comments to the script file
http://www.bigbadbrain.com/webdesign/postcomments.php .
The page postcomments.php first checks if your username and password are "u" and "p" respectively;
if valid your comment is displayed. The
page postcomments.php is expecting three parameters: username,
password, and comment.
The page should have the following features:
-
A textbox for entering your username.
-
A password box for entering your password.
-
A textarea box for entering your comment.
-
A submit button for submitting the data.
-
A reset button for clearing the form.
Use a table to ensure that the elements and their descriptors
line up so that your page appears as shown:
SELF-QUIZ