Very new at PHP so please excuse my ignorance. I started a script that basically will write the referer URL on to a page. I am stuck on the script because I can't seem to write the referer URL on to the page. Not sure whether I should use printf() or echo() command in PHP. It is not writing the referer URL to the page due to errors that I made. Please help!
The second part of my question is how do I use PHP to pass the referer URL information to the next page? Example, users surf to my site then goes to the next page, but I want to be able to pass the referer URL capture in the first page to the second page.
Thanks ahead!
<?
// set your domain
$mydomain = "mypersonalpage.com";
// only log if the referer isn't this domain
if( strstr(!$_SERVER['HTTP_REFER'],$mydomain)
{
// insert on to page
echo ('" . $_SERVER['HTTP_REFERER'] . "','" . $_SERVER['PHP_SELF'] . "')";
}
?>