To show the name of the domain name as listed in apache use:
To show the name of the URL the visitor has come from use:
PHP Code:
$_SERVER['HTTP_REFERRER']
Note: http_referrer may be blank for a number of reasons.
Javascript to display the domain name,
Code:
<script type="text/javascript">
document.write(document.domain);
</script>