Hello,
Is there a way to know from what domain name people are surfing?
By example I have domain1.com and domain2.com, they point to the same site. Can I see with a php function if the user is from domain1 or domain2 ?
Thanks
Hans
get domain name
Moderator: General Moderators
you can use $_SERVER['SERVER_NAME'];
check out the list of enviroment vars here: http://us3.php.net/reserved.variables
check out the list of enviroment vars here: http://us3.php.net/reserved.variables
Code: Select all
<?
echo $_SERVER['HTTP_HOST'];
?>