Splitting a QueryString and adding a count beside each value was needed for this most recent addition to our music site.
In the actual project, I am inserting the data into a [urlcsSub=5]SQL Server[/urlcsSub] database.
So I needed a count for each item to build the Order structure to reassemble the QueryString in the proper order.
The website is so massive and complex that this was the easiest and fastest way to perform an actual page count.
Example:
FullURL: Main.asp?Type=Code&CodeID=1&Visitor=4
Copy
Search Site
Search Google

Rewrite: Code/1/4
Copy
Search Site
Search Google
OrderValue
1Code
21
3 4
An example code for the project.
(Copy the code, paste it into a new file, save it as Main.asp, and run it with a QueryString Main.asp?Type=Code&CodeID=1&Visitor=4
Copy
Search Site
Search Google
)
[ASP VBScript - Count Values in order from QueryString]
CFFCS | CarrzSynEdit: | ASP/VBScript

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