Rob said:
Hi,
Can anyone point me in the direction of how to store information after the ?
in the url in form fields.
i.e.
http://url/test.asp?User=Rob
in Form Field UserName
Many thanks,
Rob
Store it where? In a database, cookie, session variable?
I'll presume the later in this example.
This creates Session Variables from each "name=value" pair.
<% @Language="VBScript" %>
<% Option Explicit
Dim strRQS
strRQS = Request.QueryString()
'Response.Write("<b>Request.QueryString() :</b> " & strRQS & "<hr>")
Dim arrRQS
arrRQS = Split(strRQS,"&")
Dim arrRQX
Dim intRQS
For intRQS = 0 To UBound(arrRQS)
arrRQX = Split(arrRQS(intRQS),"=")
'Response.Write("Session(" & arrRQX(0) & ") = " & arrRQX(1) & "<br>")
Session(arrRQX(0)) = arrRQX(1)
Next
%>
<html>
<head>
<title>qs_test.asp</title>
</head>
<body>
</body>
</html>
Test it with:
http://localhost/test.asp?A=a&B=b&C=c
Uncomment the "Response.Write" statement to see what happens..