Conversion functions of URLs and email addresses
<%
Function urlconvert (STR)
Convertstr = Str
Urllocation = instr (convertstr, "http ://")
If (urllocation = 0) and (maillocation = 0) then
Urlconvert = convertstr
Exit Function
End if
If urllocation <> 0 then
rightstr = STR
do while urllocation <> urllocationend
urllocation = instr (rightstr, "http ://")
urllocationend = rightstr (rightstr, "http: //")
finalstr = finalstr & left (rightstr, urlLocation-1)
midurlstr = mid (rightstr, urllocation + 126)
do while (ASC (midurlstr)> = 45) and (ASC (midurlstr) <=)
loopint = loopint + 1
midurlstr = mid (rightstr, urllocation + loopint, 1)
If midurlstr = "" Then exit do
loop
endurlstr = mid (rightstr, urllocation, loopint)
urlstr = "" & endurlstr & ""
rightstr = mid (rightstr, urllocation + loopint)
finalstr = finalstr & urlstr
loopint = 1
loop
end if
finalstr = finalstr & rightstr
Convertstr1 = finalstr
Finalstr = ""
Maillocation = instr (convertstr1 ,"@")
If maillocation <> 0 then
Do While maillocation <> maillocationend
Maillocation = instr (convertstr1 ,"@")
Maillocationend = convertstr1 ,"@")
Mainmidmailstr = mid (convertstr1, maillocation + 1, 1)
Midmailstr = mainmidmailstr
Do While (ASC (midmailstr)> = 45) and (ASC (midmailstr) <= 126)
Loopint1 = loopint1 + 1
Midmailstr = mid (convertstr1, mailLocation-loopint1, 1)
Loop
Firststr = mid (convertstr1, mailLocation-loopint1 + 1, loopint1-1)
Finalstr = finalstr & left (convertstr1, mailLocation-loopint1)
Midmailstr1 = mainmidmailstr
Do While (ASC (midmailstr1)> = 45) and (ASC (midmailstr1) <= 126)
Loopint2 = loopint2 + 1
Midmailstr1 = mid (convertstr1, maillocation + loopint2, 1)
If midmailstr1 = "" Then exit do
Loop
Secondstr = mid (convertstr1, maillocation, loopint2)
endmailstr = firststr & secondstr
mailstr = " "& endmailstr &" "
finalstr = finalstr & mailstr
convertstr1 = mid (convertstr1, maillocation + loopint2)
loopint1 = 1
loopint2 = 1
loop
end if
finalstr = finalstr & convertstr1
urlconvert = finalstr
end Function
%>