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

PHP redirectig help needed...

Discussion in 'General Programming Chat' started by playercool, Aug 17, 2009.

  1. playercool

    playercool Junior Member

    Joined:
    Jan 4, 2009
    Messages:
    159
    Likes Received:
    31
    Will try to explain this to the best of my abilities. Here is what I want to do.

    I have a landing page we will calling it landingpage.com

    I send someone an email that tells them to go to linkshortner.com which redirects them to my site landingpage.com. If they come to my page via this linkshortner I want to redirect them to the offer immediately.

    However if they just type in my landingpage.com into their browser and go there directly I want them to stay at the page without being redirected to the offer.

    Does anyone know the php code for this? It would help me tremendously.
     
  2. cyklotrial

    cyklotrial Regular Member

    Joined:
    Oct 13, 2008
    Messages:
    248
    Likes Received:
    82
    Location:
    Wonderland
    PHP:
    $referer $_SERVER['HTTP_REFERER'];
    if(
    $referer == "linkshortner.com")
        {
        
    header("Location: link_to_offer");
        }