<%
randomize()
r=rnd()
if r>0.5 then
response.write("<a href='http://www.w3schools.com'>W3Schools.com!</a>")
else
response.write("<a href='http://www.refsnesdata.no'>Refsnesdata.no!</a>")
end if
%>
<p>
This example demonstrates a link, each time you load the page, it will display
one of two links: W3Schools.com! OR Refsnesdata.no! There is a 50% chance for
each of them.
</p>
<%
Response.Buffer=true
%>
<html>
<body>
<p>
This text will be sent to your browser when my response buffer is flushed.
</p> <%
Response.Flush
%>
</body>
</html>
<%
Response.Buffer=true
%>
<html>
<body>
<p>This is some text I want to send to the user.</p>
<p>No, I changed my mind. I want to clear the text.</p> <%
Response.Clear
%>
</body>
</html>
<html>
<body>
<form action="demo_reqquery.asp" method="get">
Your name: <input type="text" name="fname" size="20">
<input type="submit" value="Submit">
</form> <%
dim fname
fname=Request.QueryString("fname")
If fname<>"" Then
Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?")
End If
%>
</body>
</html>
<%
If Request.QueryString<>"" Then
If Request.QueryString("name")<>", " Then
name1=Request.QueryString("name")(1)
name2=Request.QueryString("name")(2)
end if
end if
%>
<form action="demo_reqquery2.asp" method="get">
First name:
<input type="text" name="name" value="<%=name1%>">
<br>
Last name:
<input type="text" name="name" value="<%=name2%>">
<br>
<input type="submit" value="Submit">
</form>
<hr> <%
If Request.QueryString<>"" Then
Response.Write("<p>")
Response.Write("The information received from the form was:")
Response.Write("</p><p>")
Response.Write("name=" & Request.QueryString("name"))
Response.Write("</p><p>")
Response.Write("The name property's count is: ")
Response.Write(Request.QueryString("name").Count)
Response.Write("</p><p>")
Response.Write("First name=" & name1)
Response.Write("</p><p>")
Response.Write("Last name=" & name2)
Response.Write("</p>")
end if
%>
</body>
</html>
<html>
<body>
<form action="demo_simpleform.asp" method="post">
Your name: <input type="text" name="fname" size="20">
<input type="submit" value="Submit">
</form> <%
dim fname
fname=Request.Form("fname")
If fname<>"" Then
Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?")
End If
%>
</body>
</html>
<p>The information received from the form above was:</p> <%
If Request.Form("name")<>"" Then
Response.Write("<p>")
Response.Write("name=" & Request.Form("name"))
Response.Write("</p><p>")
Response.Write("The name property's count is: ")
Response.Write(Request.Form("name").Count)
Response.Write("</p><p>")
Response.Write("First name=" & Request.Form("name")(1))
Response.Write("</p><p>")
Response.Write("Last name=" & Request.Form("name")(2))
Response.Write("</p>")
End if
%>