faqts : Computers : Programming : Languages : PHP : Common Problems : URLs

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

8 of 10 people (80%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Is there a way to find out the refering domain as opposed to the refering page?

Feb 14th, 2002 11:13
Ben Udall, Django Bohren, http://www.php.net/manual/en/function.parse-url.php


You can use the parse_url() function to get the domain (host) from the
referer URL.
$url = parse_url($HTTP_REFERER);
echo $url['host'];