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

$10 for whoever can help -CPA Redirector Standalone Modification

Discussion in 'CPA' started by tbootz, Aug 6, 2010.

  1. tbootz

    tbootz Regular Member

    Joined:
    Dec 10, 2008
    Messages:
    248
    Likes Received:
    164
    This issue has been FIXED.

    I have a multi page static website. I want to be able to redirect different pages to different offers. This is easy to do with the WP plugin but I find it impossible with the standalone version! I know nothing about PHP but I've literally spent 20 hours the past 3 days trying to figure out how to modify the code to do this, with no luck. Help would be appreciated.


    So for example I have:

    website/page1 --> affurl1
    website/page2 --> affurl2


    and so on.

    What I have been able to do is rename the script to the actual page such as;

    page1.PHP and then add the HTML to the bottom, then upload.
    And then page2.php and so on.


    This works BUT the referrer will show as a .php subdomain. This is a big RED FLAG. If I could make the referrer show as an HTML version of the subdomain that would be far better. If I could edit the code so I can redirect multiple pages to multiple offers from this one file it would be best.

    Is this possible?
     
    Last edited: Aug 6, 2010
  2. tbootz

    tbootz Regular Member

    Joined:
    Dec 10, 2008
    Messages:
    248
    Likes Received:
    164
    Heres the code btw


    <?php

    //Standalone CPA Redirector v2.1

    //Settings

    $magic_number = 1234; // Any number you choose except ZERO!

    $cpa_offer_url = 'http://www.whatismyreferrer.com/';

    $PHP_SELF = preg_replace( "/index.php/", "", $_SERVER['PHP_SELF'] );


    //Don't edit below this line unless you know what you are doing.

    if (isset($_GET['mn']) && $_GET['mn']==$magic_number){

    echo '<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body><form action="' . 'http://'.$_SERVER['HTTP_HOST'].$PHP_SELF. '" method="post" id="form1">

    <input type="hidden" name="mn" value="' . $magic_number . '" /></form>

    <script language="JavaScript">
    document.getElementById(\'form1\').submit();</script></body></html>';
    return true;
    exit();
    }

    if ($_POST['mn']==$magic_number){

    echo '<html><head><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head><body><form action="' . 'http://'.$_SERVER['HTTP_HOST'].$PHP_SELF. '" method="post" id="form1">

    <input type="hidden" name="mn" value="' . $magic_number . $magic_number . '" /></form>

    <script language="JavaScript">
    document.getElementById(\'form1\').submit();</script></body></html>';
    return true;
    exit();
    }

    $dom = preg_replace( "/^www\./", "", $_SERVER[ 'HTTP_HOST' ] ) ;
    $ref= $_SERVER['HTTP_REFERER'];


    if (((strpos($ref, $dom)!=FALSE) || (trim($ref)=="" ) ) && (!isset($_GET['mn'])) && ($_POST['mn']==$magic_number.$magic_number)){
    header( 'Location: ' . $cpa_offer_url);
    exit();
    }


    ?>