India Forums .Info

Discuss Cars, Bikes, Jobs, Romance, Marriage, Jobs, Real Estate, Programming and more..
It is currently Tue Dec 02, 2008 3:04 am

All times are UTC + 5:30 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: URLDecode Function
PostPosted: Fri Feb 23, 2007 10:52 am 
Offline
Newbie

Joined: Tue Feb 06, 2007 4:50 pm
Posts: 37
URLDecode Function

The URLDecode function decodes a URL encoded string back into the original text.

Code:
<%
Private Function URLDecode(ByVal encodedstring)
    Dim strIn, strOut, intPos, strLeft
    Dim strRight, intLoop
    strIn = encodedstring : strOut = _
         "" : intPos = InStr(strIn, "+")
    Do While intPos
        strLeft = "" : strRight = ""
        If intPos > 1 Then _
            strLeft = Left(strIn, intPos - 1)
        If intPos < Len(strIn) Then _
            strRight = Mid(strIn, intPos + 1)
        strIn = strLeft & " " & strRight
        intPos = InStr(strIn, "+")
        intLoop = intLoop + 1
    Loop
    intPos = InStr(strIn, "%")
    Do While intPos
        If intPos > 1 Then _
            strOut = strOut & _
                Left(strIn, intPos - 1)
        strOut = strOut & _
            Chr(CInt("&H" & _
                Mid(strIn, intPos + 1, 2)))
        If intPos > (Len(strIn) - 3) Then
            strIn = ""
        Else
            strIn = Mid(strIn, intPos + 3)
        End If
        intPos = InStr(strIn, "%")
    Loop
    URLDecode = strOut & strIn
End Function
%>


sourcecodesworld.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 5:30 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO