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

Quick script I wrote to increase your clicks

Discussion in 'Affiliate Programs' started by TheInsider, Nov 11, 2009.

  1. TheInsider

    TheInsider Registered Member

    Joined:
    Jan 18, 2008
    Messages:
    99
    Likes Received:
    102
    I use the following code to make all my promoted affiliate programs get uniques... Example.. You send traffic to one offer, normally only that offer gets the traffic.. Using my method, all your offers get the traffic, basically PADDING the stats..

    First off, make a file called image.jpg that is a 1x1 white pixel image. Replace the urls below with the urls of all your link codes you want to send traffic to. You can remove or add links by increasing/decreasing the $v = (rand()%8);
    variable. Remember 0 is counted as a #, so if you have nine links, you use 8 in the variable.

    THEN, as an added bonus, my script logs the information of the click to a file called log.html. Just create a 0 byte file in the directory, before executing..

    If you pass the variable ?e=email@email.com it will log the email of the person. Everything is pulled from the environment.. Time, IP and referral.

    The best part of this script is there is no hidden frames. Everything is loaded in the background. AND you call it as an image!

    Example: <img src="http://www.testserver.com/image.php?e=%SURFEREMAIL%">

    Just take the following code and save it as image.php on your server...

    PHP:
    <?php
    header
    ('Content-type: image/jpeg');
    readfile('image.jpg');

    #Get our variables for writing
    $IP $_SERVER['REMOTE_ADDR'];
    $referral $_SERVER['HTTP_REFERER'];
    $time date ("F dS, H:i");
    $e = (isset($_GET["e"]) && !empty($_GET["e"]) ? $_GET["e"] : "");

    srand(time());
    $v = (rand()%8);
    if (
    $v == 0) { $contents file_get_contents('http://url.1.com'); }
    if (
    $v == 1) { $contents file_get_contents('http://url.2.com'); }
    if (
    $v == 2) { $contents file_get_contents('http://url.3.com'); }
    if (
    $v == 3) { $contents file_get_contents('http://url.4.com'); }
    if (
    $v == 4) { $contents file_get_contents('http://url.5.com'); }
    if (
    $v == 5) { $contents file_get_contents('http://url.6.com'); }
    if (
    $v == 6) { $contents file_get_contents('http://url.7.com'); }
    if (
    $v == 7) { $contents file_get_contents('http://url.8.com'); }

    #Get our File Handle and set for appending
    $filehandle fopen ("log.html""a");

    #Lets begin to write!
    fwrite $filehandle"<b>Time Accesssed:</b> $time<br>" );
    fwrite $filehandle"<b>Email:</b> $e<br>" );

    #Does the IP exist or referer? Check before attempting to write!
    if ( $IP != null )
    {
    fwrite $filehandle"<b>IP Address:</b> $IP<br><hr>" ) ;
    }
    if ( 
    $referral != null )
    {
    fwrite $filehandle"<b>Referer:</b> $referral<br><hr>" );
    }
    fclose $filehandle );
    ?>
    Oh, and to see who loaded your page.. just goto http://www.testserver.com/log.html in your web browser.

    If you experience problems, make sure that log.html is read/writable (777)
     
    • Thanks Thanks x 5
  2. Gofobu

    Gofobu Registered Member

    Joined:
    Aug 15, 2009
    Messages:
    73
    Likes Received:
    28
    Occupation:
    Internet Marketer
    Why I am by no means an expert, this sounds like CS. Or am I totally off?
     
  3. TheInsider

    TheInsider Registered Member

    Joined:
    Jan 18, 2008
    Messages:
    99
    Likes Received:
    102
    Now you are understanding the true potential! ;)

    I've actually used this script to make a non-optinlist an optinlist, because I suddently had timestamps and dates of when they joined my list, all simply because they happened to open an email they received ;) hahah
     
  4. TheInsider

    TheInsider Registered Member

    Joined:
    Jan 18, 2008
    Messages:
    99
    Likes Received:
    102
    CS? please elaborate. I am relatively new to the BHW world and still learning all the acronyms :)
     
  5. origin

    origin Regular Member

    Joined:
    Nov 11, 2008
    Messages:
    334
    Likes Received:
    90
    Home Page:
    CS: Cookie Stuffing
     
  6. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    Thank you so much dude.. Like, actually.
     
  7. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    Don't mind me asking the noob question of the day, but how would you go about building an email list with this method?
     
  8. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    Ok cool, thanks for the response.

    I'm having troubles making this work.. *sigh*

    Can anyone give me a hand, I don't understand what file to call the images/how to even call all the images.. I've tried different ways but it always comes up with broken images or nothing at all.
     
  9. dacash

    dacash Registered Member

    Joined:
    Jan 28, 2008
    Messages:
    51
    Likes Received:
    15
    Location:
    on the dark side.
    You could of made this script lot shorter and easier for people to add and remoe links. :p
     
  10. TheInsider

    TheInsider Registered Member

    Joined:
    Jan 18, 2008
    Messages:
    99
    Likes Received:
    102
    I am far from a programmer! Hahaha.. When the need arises I sit down and try to come up with a solution. Sometimes I do it in 5 minutes, sometimes it takes me weeks! I should take a php class haha.. Either way, I just thought it would be helpfull to some.
     
  11. TheInsider

    TheInsider Registered Member

    Joined:
    Jan 18, 2008
    Messages:
    99
    Likes Received:
    102
    Did you create a 1x1 image.jpg file and put it in the directory of the program? You can do this with any image software. Just say file new size 1 pixel by 1 pixel, white background, then save it for web.
     
  12. matapples01

    matapples01 Regular Member

    Joined:
    May 15, 2008
    Messages:
    358
    Likes Received:
    208
    I can't program my way out of a wet paper bag but I'm seeing some potential in this. Gonna play with it a little tonight. Thanks for the share.
     
  13. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    I've tried everything.. does anyone have an example to show? Mine don't seem to work.
     
  14. matapples01

    matapples01 Regular Member

    Joined:
    May 15, 2008
    Messages:
    358
    Likes Received:
    208
    Maybe make the image src on your page be image.jpg, not the image.php like he has mentioned above. It looks like the code may be telling it to treat image.jpg as php and run the script. I haven't played with it yet so I may be off on this but unless that's the case I don't see why you would create the 1x1 image file because it isn't referenced anywhere on the page.
     
  15. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    Unfortunately, I tried deleting the 1x1 image and everything.. Still no luck

    EDIT:

    This is what I'm using.

    index.html
    Code:
    <html>
    <head><title>Test Title</title>
    </head>
    <body>
        <font face='verdana' size='1'>Sally doesn't sell sea shells on the sea shore koz she's a hooker.</font><br/>
        <img src='http://freestuffeasy.info/tester/image.php'>
    </body>
    </html>
    image.php
    Code:
    <?php
    
    header('Content-type: image/jpeg');
    
    readfile('image.jpg');
    
    #Get our variables for writing
    
    $IP = $_SERVER['REMOTE_ADDR'];
    
    $referral = $_SERVER['HTTP_REFERER'];
    
    $time = date ("F dS, H:i");
    
    $e = (isset($_GET["e"]) && !empty($_GET["e"]) ? $_GET["e"] : "");
    
    srand(time());
    
    $v = 1;
    
    if ($v == 0) { $contents = file_get_contents('offer1'); }
    if ($v == 1) { $contents = file_get_contents('offer2'); }
    if ($v == 2) { $contents = file_get_contents('offer3'); }
    if ($v == 3) { $contents = file_get_contents('offer4'); }
    if ($v == 4) { $contents = file_get_contents('offer5'); }
    
    #Get our File Handle and set for appending
    $filehandle = fopen ("log.html", "a");
    
    #Lets begin to write!
    fwrite ( $filehandle, "<b>Time Accesssed:</b> $time<br>" );
    fwrite ( $filehandle, "<b>Email:</b> $e<br>" );
    
    #Does the IP exist or referer? Check before attempting to write!
    if ( $IP != null )
    {
    fwrite ( $filehandle, "<b>IP Address:</b> $IP<br><hr>" ) ;
    }
    if ( $referral != null )
    {
    fwrite ( $filehandle, "<b>Referer:</b> $referral<br><hr>" );
    }
    fclose ( $filehandle );
    ?>
     
    Last edited: Nov 11, 2009
  16. matapples01

    matapples01 Regular Member

    Joined:
    May 15, 2008
    Messages:
    358
    Likes Received:
    208
    I think I may have been wrong with what I said earlier. Anyway, a couple things to try.

    First create the 1x1 .jpg image and make sure to put it into to the proper place. It looks like you're using the "tester" folder, so put it in there. Second, in the php code where it says readfile('image.jpg'); he has his image.jpg in, and the script is looking for the image.jpg, in the root. If yours is in a sub-folder /tester/image.jpg, you need to change that piece of the code to the (correct) absolute path. Make it readfile('http://freestuffeasy.info/tester/image.jpg');

    Give that a whirl and see if it does anything.
     
    Last edited: Nov 11, 2009
  17. Scrog

    Scrog Registered Member

    Joined:
    Jun 18, 2009
    Messages:
    54
    Likes Received:
    37
    I dont know what the problem is, my log records every view but I'm not getting a single click showing...
     
  18. clopper

    clopper Regular Member

    Joined:
    Dec 3, 2007
    Messages:
    300
    Likes Received:
    94
    Occupation:
    Food and Beverage Director
    Location:
    USA
    thanx
     
  19. tejsin

    tejsin Power Member

    Joined:
    Nov 15, 2010
    Messages:
    752
    Likes Received:
    118
    Occupation:
    CEO
    Location:
    Europe
    Home Page:
    ANyone is so kind to explain to me how do you put PHP in html?
    Please :D
     
  20. ilikebh

    ilikebh Junior Member

    Joined:
    Jun 17, 2010
    Messages:
    145
    Likes Received:
    14
    I still don't get how this captures everyones emails ?

    I just edit this and paste this code on a site and i'll get all my visitors emails ?

    OR , I edit the code , email out to a partners emails list and I get all my partners emails as optin if they happen to just open their email ?

    Whichever way , this seems really powerful .