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