Get Referring URL with PHP

<?php
//get pg referer if there is one
    if (isset($_SERVER['HTTP_REFERER'])) {
    $ref_url = $_SERVER['HTTP_REFERER']; //get referrer
    }else{
    $ref_url = 'No referrer set'; // show failure message
    }//end else no referer set
echo "<h3>Refferring URL: $ref_url</h3>";
?>

Leave a Reply

Your email address will not be published. Required fields are marked *