<%
Function URLDecode(EncodedString)
Dim oRegEx, sEncoded, sDecoded
' Replace the + signs first, which represent spaces in RFC-1866 encoding
sEncoded = Replace(EncodedString, "+", " ")
' Use a RegExp object to find and replace %xx hex codes
Set oRegEx = New RegExp
oRegEx.Pattern = "%([0-9A-Fa-f]{2})"
oRegEx.Global = True
sDecoded = oRegEx.Replace(sEncoded, GetChar)
URLDecode = sDecoded
Set oRegEx = Nothing
End Function
' Get the raw query string (e.g., "Main.asp?Type=Code&CodeID=1&Visitor=4")
rawQueryString = Request.ServerVariables("QUERY_STRING")
If rawQueryString <> "" Then
' Split the string into an array of parameters using the ampersand as a separator
paramsArray = Split(rawQueryString, "&")
RNum = 1
' Loop through each parameter
For Each param In paramsArray
' Split each parameter into a key and a value using the equals sign
keyValue = Split(param, "=")
If UBound(keyValue) = 1 Then
strColName = URLDecode(keyValue(0))
strColValue = URLDecode(keyValue(1))
Response.Write("Num: " & RNum & ", Value: " & value & "
")
' To insert the record into a Database Table.
' Add the RNum.
' Example
' getPD.Parameters.Append getPD.CreateParameter("@Order", adInteger, adParamInput, , RNum)
RNum = RNum + 1 ' Set to the bottom of all your code.
End If
Next
End If
%>