Using QueryString
In this example we will request 3 items of information. The users
first name, last name and password. We will then place these items
in a query string and display on the next page.
Note that Firstname and Lastname will be saved in the same Querystring
item. firstname in position 1 and Lastname in position 2.
<html>
<head>
<title> Request QueryString</title>
</head>
<body>
<p>
<form name=QueryString Action="RequestQuery.asp" method="get">
Type your first name: <Input type=text name="name">
<br>
Type your last name <input type=text name="name">
<br>
<!--
Not that both firstname and Lastname are save in the same item called "name".
//-->
Type your password: <input type=text name="pass>
<br>
<input type=submit value=login>
</form>
<br>
<Hr>
<o>
The information received from the QueryString object was:
<p>
Name= <%=Request.QueryString("name")%>
<br>
Passwo= <%=Request.QueryString("pass")%>
<br>
The 'name' property's count is <%=Request.QueryString("name").Count%>
<br>
<%
if not isempty (Request.QueryString("Name")) then
%>
<!--
First ensure that name is not empty to prevent a runtime error.
//-->
First name =<%=REquest.QuerString("Name")(1)%>
<br>
Last name =<%=REquest.QuerString("Name")(2)%>
<!--
Now access first and lst names for position 1 and 2 in Name)
//-->
<%end if%>
<p>
<%=Request.QueryString%>
<br>
<%=Reqest.ServerVariables("QUERY_STRING")%>
<br>
</body>
</html>
|