View Full Version : parse out domain
08-12-2007, 02: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
08-13-2007, 02:47 PM
Here are the rest of the Request objects for you to look through:
08-13-2007, 02: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)
08-13-2007, 02: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.
08-13-2007, 07:29 PM
have a look here (http://classicasp.aspfaq.com/general/how-do-i-parse-the-domain-name-out-of-a-url.html)
01-18-2008, 08:24 AM
what if I wanted to take "http://localhost/portfolio/attics/default.asp" and strip out "http://localhost/portfolio/". Is that possible?
01-18-2008, 12:26 PM
RegExp will help you.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.