1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Click on banner before enter - Can somebody help? thx

Discussion in 'Content Management' started by findacoder, Jul 16, 2006.

  1. #1
    Hi, i am looking for a code that makes my visitors to click on some of the banners listed to be able to enter into the website.
    Is that possible?

    I saw some sites doing it, and want to implement to my website, do anybody know the code?

    Thanks a lot in advance!
     
    findacoder, Jul 16, 2006 IP
  2. aras

    aras Active Member

    Messages:
    533
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #2
    Very very simple one.

    
    // Insert this to the head of the main site
    if (!$_COOKIE[click]) {
    die ("Please click on banner before entering the site");
    }
    
    PHP:
    Change the link to the banner. For ex:
    <a href="click.php"><img src="somebanner.gif"></a>

    click.php
    
    setcookie("click","nice thing",time()+3600);
    header("Location: http://oldbannerlocation");
    
    PHP:
     
    aras, Jul 16, 2006 IP
  3. findacoder

    findacoder Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    this have to be added in the main page of the website?
    or i have to create a full new page for this?
     
    findacoder, Jul 16, 2006 IP
  4. findacoder

    findacoder Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    and also, is this possible to make for multiple banners?
    i mean, to have different options for the user to click?
     
    findacoder, Jul 16, 2006 IP
  5. aras

    aras Active Member

    Messages:
    533
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #5
    First one must go in the very up side of main page. Other one (click.php) is a seperate file. Logic is same, click.php file sets a cookie to user that they have clicked on banner and redirect them to the banner url. The checker section checks whether there is cookie or not.

    You can do it for multiple banners of course. For ex:

    click.php
    
    
    // Define URL's to go for banners
    
    $url = array(
       1 => "http://www.yahoo.com",
       2 => "http://www.google.com",
       3 => "http://www.altavista.com");
    
    // Define the number of url from address bar
    $num = addslashes(htmlspecialchars($_GET[id]));
    
    // Set cookie for a click
    setcookie($num,$num,time()+3600);
    
    // Go that URL
    header("Location: $url[$num]");
    
    PHP:
    Banner code for yahoo is click.php?id=1
    Banner code for google is click.php?id=2 .. and so on.

    Each click sets a seperate cookie so you can decide to check all or partial in the checking section.

    Hope this helps.
     
    aras, Jul 17, 2006 IP
  6. findacoder

    findacoder Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    the main problem i have is that my page its on wordpress
    and dont know where to set the inicial code
    as i dont have separated the header and body
    its a php file
    can you check it? my site is gangstalinks.com (caution, its adult, if you dont want to enter its ok) and see the source code of the main page? where do i have to add it?
     
    findacoder, Jul 17, 2006 IP
  7. aras

    aras Active Member

    Messages:
    533
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Somewhere upper in index.php is ok i guess, or another method is, do not place links or passwords in the main page, just say click here to get password and url and redirect them to an outer php page (which checks banner clicks and shows them video download urls). Of course that will need some personal coding other than Wordpress.

    I built this method on another adult site however, it was not wordpress, was a custom php model.
     
    aras, Jul 17, 2006 IP
  8. findacoder

    findacoder Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    can you contact me over mail to findacoder at gmail ?
    maybe we can make something
    Thanks
     
    findacoder, Jul 17, 2006 IP
  9. tke71709

    tke71709 Peon

    Messages:
    536
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You of course know that forcing your users to click on a banner will get you quickly banned from any CPM/CPC ad network out there right?
     
    tke71709, Jul 17, 2006 IP
  10. findacoder

    findacoder Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    its not related to ppc or cpm program
    dont worry
    its just to vote on some networks
     
    findacoder, Jul 17, 2006 IP