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

Is there a way to....

Discussion in 'CPA' started by thepassionofchad, Dec 1, 2011.

  1. thepassionofchad

    thepassionofchad Newbie

    Joined:
    May 19, 2007
    Messages:
    24
    Likes Received:
    2
    ...have a content locker not trigger when the visitor is from a certain referrer? As in when someone comes from youtube the content locker doesn't trigger but when they visit a different page on my site after coming from youtube it will trigger the locker?
     
  2. italy1677

    italy1677 Newbie

    Joined:
    Aug 20, 2011
    Messages:
    18
    Likes Received:
    3
    Well you can use php to do this. I'm assuming you mean as soon as the referrer is from your own site or some other traffic source (second page if they came from youtube) it activates?

    You could just blank the referrer, it would be the easiest thing to do.

    Code:
    <?php
    $referer = $_SERVER['HTTP_REFERER'];
    $youtube = substr($referer,0,29);
    if($youtube != "put the first 29 characters of the url from a youtube video including http to the ? at the end of watch")
    {
    echo "locker code";
    }
    
    I couldn't post the code with if statement properly because of my inability to post urls, so if you don't get it PM me.
    Please note that all double quotes in the locker code will need to have a back slash in front of them! This is necessary so the code doesn't think that the quote is the end of the echo. Ex. "<div id=\"link\"></div>"
     
    • Thanks Thanks x 1
    Last edited: Dec 2, 2011
  3. thepassionofchad

    thepassionofchad Newbie

    Joined:
    May 19, 2007
    Messages:
    24
    Likes Received:
    2
    Thanks, looks like something I could use. Is this for a specific youtube URL? To be more specific I'd like to have the locker not trigger if the visitor comes from any youtube page or from another site I deem, like TV-Links.eu or a torrent site. What I'm trying to accomplish is for them to get one free video but when they go to view another then they have to complete an offer. This way they don't get pissed and report the link as bad and I have a repeat customer.
     
  4. italy1677

    italy1677 Newbie

    Joined:
    Aug 20, 2011
    Messages:
    18
    Likes Received:
    3
    It will not show the gateway if the referrer is from any youtube video. Easiest way to have that set up to block youtube and tv-links would be to have the if statement have multiple conditions so that the referrer is not the same as the domains you don't want the gateway to show on. If you pm me a link of the sites you don't want to show the gateway for and the gateway code/activation code, I'll put it into the script so it works for what you need :)