esthera
08-12-2007, 01:40 PM
how can i easily parse out a domain from a string
meaining if i take in a string http://www.xxx.com/mytestpage.html
it will always return just the www.xxx.com without the rest of it
Daemonspyre
08-13-2007, 01:47 PM
response.write Request.ServerVariables("SERVER_NAME")
Here are the rest of the Request objects for you to look through:
http://msdn2.microsoft.com/en-us/library/ms524602.aspx
esthera
08-13-2007, 01:53 PM
I don't want the server variables -- I want to parse it out of a string (i'm actually taking it from referrer)
Spudhead
08-13-2007, 01:56 PM
Well if you split the full URL on "//", and then split the remainder on "/", you're going to end up with the domain as the first element in your new array.
mehere
08-13-2007, 06:29 PM
have a look here (http://classicasp.aspfaq.com/general/how-do-i-parse-the-domain-name-out-of-a-url.html)
silverskymedia
01-18-2008, 07:24 AM
what if I wanted to take "http://localhost/portfolio/attics/default.asp" and strip out "http://localhost/portfolio/". Is that possible?
Whatever Jr.
01-18-2008, 11:26 AM
Sure,
RegExp will help you.
HTH, Tom