Well, if all you want to do is grab the domain name you can use the above links to strip it down like so:
Use the Replace function to remove the "http://" and "www." part like so:
strInput = "http://www.google.com.au/?var=34sa&ada=adklfjadfa&adfaadfa=akdfadfa"
strTmp = replace(strInput,"http://","")
strTmp = replace(strTmp,"https://","")
strTmp = replace(strTmp,"www.","")
|
Then use the Instr Function to find the first "/" next
(being the end of the domain name now we've removed the "http://" part)
intPos = InStr(strTmp,"/") |
Then use Mid to strip the end off like so:
strOutput = Mid(strTmp,1,intPos) |
Putting it all together you get:
strInput = "http://www.google.com.au/?var=34sa&ada=adklfjadfa&adfaadfa=akdfadfa"
strTmp = replace(strInput,"http://","")
strTmp = replace(strTmp,"https://","")
strTmp = replace(strTmp,"www.","")
intPos = InStr(strTmp,"/")
strOutput = Mid(strTmp,1,intPos)
Response.Write(strOutput)
|
The links I provided did explain the functions (which is why I provided them), So you should of been able to do this your self.
And if you know PHP then the
this page has helped me go from ASP to PHP.