Not sure if there is a better way of doing this.
I need to put some code on each page of a site that will take the http referrer and extract the domain name for checking in an affiliate program.
I imagine this is a pretty common thing, like checking the validity of an email address, but I've not achieved it successfully with string commands yet.
I would like to get domain out of
http://abc.domain.com/this_and_that/whatever.php
or
http://domain.org/more_here/whatever/funghi.xml
I need an apple to hit me on the head, I think.