1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

simple php error, help!

Discussion in 'PHP & Perl' started by younglungs, Jul 27, 2008.

  1. younglungs

    younglungs Junior Member

    Joined:
    May 10, 2008
    Messages:
    189
    Likes Received:
    35
    alright so i'm trying to set up this script for insuring that my referrers are blank before sending them on to e*Bay but i'm getting this error:

    Parse error: parse error, unexpected $ in /home/www/my-domain.com/go.php on line 7

    and here is the code:

    Code:
    <?php 
    if(trim($_SERVER["HTTP_REFERER"])==""){ 
    echo '<meta http-equiv="refresh" content="0;url=ebay-affiliate-url">'; 
    }
    else
    {
    echo '<meta http-equiv="refresh" content="0;url=http://www.google.com">';
    can anyone help me with this? i know it's something simple but i have absolutely no programming knowledge. thanks!
     
  2. BlackBeret

    BlackBeret Regular Member

    Joined:
    Jul 12, 2008
    Messages:
    257
    Likes Received:
    61
    Location:
    Transexual, Transylvania
    Do you have a closing } to close out the one before the else echo?

    Everything looks ok, my knowledge is a little limited also.
     
    • Thanks Thanks x 1
  3. luxint

    luxint Registered Member

    Joined:
    Jun 16, 2008
    Messages:
    68
    Likes Received:
    22
    I just put the closing brace and the final php tag and it worked fine.

    Code:
    <?php 
    if(trim($_SERVER["HTTP_REFERER"])==""){ 
    echo '<meta http-equiv="refresh" content="0;url=ebay-affiliate-url">'; 
    }
    else
    {
    echo '<meta http-equiv="refresh" content="0;url=http://www.google.com">';
    }
    ?>
    
    Lux
     
    • Thanks Thanks x 1
  4. barigain

    barigain Junior Member

    Joined:
    Aug 23, 2012
    Messages:
    100
    Likes Received:
    12
    maybe there loading the content in via ajax?