I am trying to create a tell a friend script

I am using

if($SERVER['HTTP_REFERRER'] == NULL){
$sitename = 'Http://www.mysite.org/';
} else {
$sitename = $
SERVER['HTTP_REFERRER'];
}

For some reason it is not picking up the referrer.
It is always sending to the index.php page.

what am I doing wrong?

    try

    if($_SERVER['HTTP_REFERER'] == NULL){
    $sitename = 'Http://www.mysite.org/';
    } else {
    $sitename = $_SERVER['HTTP_REFERER'];
    } 
    
      1. Fix the spelling: 'HTTP_REFERER'
      2. HTTP_REFERER is unreliable and thus may sometimes not contain the value of the previous page.
      3. Use echo to display the value of HTTP_REFERER while you are troubleshooting.
      4. Try using the functions isset() or empty() instead of == NULL

        okay. now I get the page I am on. (tellfriend.php) as the value.
        How do I get the page that I clicked on tellfriend.php from?

          Write a Reply...