For those that are interested - this is the way I am doing it. (Attached)

Anybody got any cleaner ideas?

Rgds,
Troy

-----Original Message-----
From: Troy Kelly 
Sent: Thursday, 6 March 2003 22:13
To: '[EMAIL PROTECTED]'
Subject: ASP QueryString

Hi Folks,

Not sure if anybody can help me - I am sure this should work - but I am at a
bit of a loss...

The code below shows that ASP interprets a '%00' in the querystring as EOF.
Does anybody know how to possibly treat this string as binary and get the
whole thing?

It is kinda useless being able to get the UDH / Binary message text via a
querystring if every %00 is going to truncate it :)

Regards,
Troy

<%

Response.Buffer = False


Response.Write "<PRE>" & vbCrLf
Response.Write "H:" & URLEncode(Request.Querystring("h")) & vbCrLf
Response.Write "LEN:" & LEN(Request.Querystring("h")) & vbCrLf
Response.Write "</PRE>" & vbCrLf

Private Function URLEncode(URL)
    Dim strChar, intPos, strUrl, intASC, strHEX
    For intPos = 1 To Len(URL)
        intASC = Asc(Mid(URL, intPos, 1))
        If (intASC >= 65 AND intASC <= 90) or (intASC >= 97 AND intASC <=
122) OR (intASC >= 48 AND intASC <= 57) Then
                strUrl = strUrl & Chr(intASC)
         ELSE
                strHEX = Trim(Hex(intASC))
                If Len(strHEX) = 1 Then strHEX = "0" & strHEX
                strUrl = strUrl & "%" & strHEX
        End If
    Next
    URLEncode = REPLACE(strUrl,"%20", " ")
End Function
%>


intStartPos = InStr(Request.ServerVariables("QUERY_STRING"),"message=") + 8
intEndPos = InStr(intStartPos,Request.ServerVariables("QUERY_STRING"),"&") 
if intEndPos = 0 Then
        intEndPos = Len(Request.ServerVariables("QUERY_STRING"))
 Else
        intEndPos = intEndPos - 1
End If
strMessage= Mid(Request.ServerVariables("QUERY_STRING"),intStartPos,(intEndPos + 1) - 
intStartPos)

Reply via email to