WebBuilder101 - Making the web happen!
Need Web Dev software? Here is the place to
Flash Point

Working with Form Input


The ASP file you have to create - "confirmation.asp"

Now we have to create the variable that's going to hold the data colected through the form.

1 <%
2 Dim strName
3 strName = Request.Form ("Name")
4 %>

The first and fourth lines tell the server to begin and end a section of ASP code. Note that all ASP code must be within the <% %> delimiters.

The second line creates a variable called strName. Dim stands for "dimension", it tells the computer that you are setting up a new variable.

In the third line, we set the contents of strName to a value ASP has requested from the server - in our example this value would be a name entered by a user in the "Name" field of our Form, the code used to accomplish this is Request.Form ("Name").

Now that we have our data stored in a variable, we need a piece of code that will help us write the contents of that variable to our confirmation page. Here is what we need:

5 Response.Write strName

Here, all we are doing is to tell the server to write the contents of strName in our confirmation page. Below is what the ASP code should look like in our confirmation.asp page.

<%
Dim strName
strName = Request.Form ("Name")
Response.Write strName
%>

Now, let's see it in action.

 

Back Back to the previous page
.

 

More Resources
Dynamic Sites
Creating Forms
Forms and Form Handlers
Form handler

Suggested Reading

Beginning Active Server Pages 3.0
JavaScript Bible
Red Hat Linux
Dreamweaver 3.0
HTML Bible



Download WB101 Wallpaper
• Web Builder 101 Wallpaper Get it!.
• Find out how to create your own Wallpaper Teach me!.
Sign up for our Newsletters
• Web Building Sign me Up!.
• Net Alert! Sign me Up!.
Need Help?
• Contact Support Click here.
• E-mail the Webmaster Click Here.
• Search Tips Click Here.

Webbuilder101.com © 1998 - 2003 Copyright and Terms of Use
Send mail to: webmaster@webbuilder101.com

» About » Support

» FAQ » What's New » MyLog

Web Builder 101 Web Builder 101 - Making the Web Happen Web Builder 101 - Making the Web Happen
.