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

Do I have this iframe/CPA/refer setup correct?

Discussion in 'CPA' started by mataff, Feb 2, 2010.

  1. mataff

    mataff Junior Member

    Joined:
    Sep 21, 2008
    Messages:
    139
    Likes Received:
    54
    Everything is pieced together from posts in this forum but I want to make sure I'm understanding the entire setup (fake refer, etc) by coming up with my own test environment before I add more features to it (geo target, campaign codes, etc). I used cakeslice to select the portion and the code itself is from Genjutsu (http://www.blackhatworld.com/blackhat-seo/302483-post56.html). Thank you for this btw.

    End result:
    AFFPAGE1.php shows [HTTP_REFERER] => hxxp://mydomain.com/enter2.php
    AFFPAGE2.php shows [HTTP_REFERER] => hxxp://mydomain.com/affpage1.php (After hitting submit in the iframed window).

    Also when you visit the initial refer directly: hxxp://mydomain.com/enter2.php it defaults to printing out echo 'White Hat Page';

    Questions:
    1. Now what I'm lead to believe is the actual framed request is the portion that has to be fake refered which is what is taking place here. Am I correct?
    2. Also if that method is correct for faking the referrer will this work if those aff pages contain javascript in it?

    Here's the code I'm using:

    MAIN PAGE.php
    Code:
    <?php
    echo '<html><body>'; 
    echo '<div style="overflow: hidden; width: 974px; height: 732px; position: relative;" id="i_div">
    <iframe name="i_frame" src="http://mydomain.com/enter1.php" style="border: 0pt none ; left: -5px; top: -32px; position: absolute; width: 1083px; height: 784px;" scrolling="no"></iframe></div>'; 
    echo '</body></html>'; 
    ?>
    ENTER1.php
    Code:
    <?php
    
    $site2 = "http://mydomain.com/enter2.php";
    
    echo "<body onload=\"javascript:frmClickTracking.submit();\">";
    echo "<form action=\"" . $site2 . "\" method=\"post\" name=\"frmClickTracking\">";
    echo "</form>";
    
    ?>
    ENTER2.php
    Code:
    <?php
    
    $site1 = "http://mydomain.com/enter1.php"";
    $affiliate_link = "http://mydomain.com/affpage1.php";
    
    if($_SERVER['HTTP_REFERER'] == $site1)
    {
    	echo "<body onload=\"javascript:frmClickTracking.submit();\">";
    	echo "<form action=\"" . $affiliate_link . "\" method=\"post\" name=\"frmClickTracking\">";
    	echo "</form>";
    }
    else {
    	
    echo '<html><body>'; 
    echo 'White Hat Page'; 
    echo '</body></html>'; 
    
    }
    AFFPAGE1.php
    Code:
    <?php
    
    echo'
    <html>
    <body>'; 
    echo '<h1>PAGE 1</h1>'; 
    echo'<form action="aff-page2.php" method="post"><br>
    Name: <input type="text" name="name" /><br>
    Email: <input type="text" name="email" /><br>
    <input type="submit" /><br>
    </form>'; 
    echo '<pre>'; 
    print_r($_SERVER);
    echo '</pre>'; 
    
    echo'</body></html> '; 
    
    ?>
    AFFPAGE2.php
    Code:
    <?php
    
    $name = $_POST['name']; 
    $email = $_POST['email']; 
    
    echo'<html><body>'; 
    
    echo '<h1>PAGE 2</h1>'; 
    echo'<form action="aff-page3.php" method="post">
    Zip: <input type="text" name="zip" /><br>
    First Name: <input type="text" name="firstname" /><br>
    Last  Name: <input type="text" name="lastname" /><br>
    <input type="submit" />'; 
    echo '<pre>'; 
    echo $name . '<br>';
    echo $email . '<br>'; 
    print_r($_SERVER);
    echo '</pre>'; 
    echo '</form></body></html> '; 
    
    ?>
     
    Last edited: Feb 2, 2010
  2. mataff

    mataff Junior Member

    Joined:
    Sep 21, 2008
    Messages:
    139
    Likes Received:
    54
    Just looking for a yes or no then. If that makes it easier. I just want to know if I'm on the right track.