Lets say this pages linked to my website
domain.com
domain.com/page.php
domain.com/anotherpage.html
Using $HTTP_REFFERER to find that they have sent a click to my website, how do I remove everything after the slash so I can match domain.com with my records?
$HTTP_REFFERER
Moderator: General Moderators
Code: Select all
$home = "domain.com";
$refer = substr($HTTP_REFERER, 0, strlen($home));That substr code seem to return http://www no matter what site links to me...
How would I use the parse_url funcrion?
How would I use the parse_url funcrion?
domain.com/page.php
lots of info in the manual for parse_url
Code: Select all
$splitUrl = parse_url($HTTP_REFFERS);
echo $splitUrl['host'];
//should echo out domain.com