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!
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:
and also, is this possible to make for multiple banners? i mean, to have different options for the user to click?
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.
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?
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.
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?