2.4 HTML2 - Processing Forms
OBJECTIVE
DISCUSSION
Processing Forms - Example
<form action =
"http://www.bigbadbrain.com/western/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 Approach to Email Form Data
<form action = "MAILTO: abc@xyz.orc"
method = "post" enctype="text/plain"></form>
EXERCISES
-
Explain the difference between get and post.
-
Create a page for submitting comments. Your page should submit your name,
password and comments to the script file
http://www.bigbadbrain.com/western/postcomments.aspx .
The page postcomments.aspx first checks your username and password;
if valid your comment is added to the database and displayed. MAKE
sure that you do not share your username and password with anyone else.
The page webform1.aspx is expecting three parameters: username,
password, and comment.
Keep in mind that you do not want your password to be exposed to anyone.
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.
3. Save the form that you created in #2 as another page. Then
modify it so that the information is emailed to someone.
LINKS AND HELP