Easily Avoid Clicking Your Own Ads With PHP

Here’s a nifty little script I came across that will prevent you from seeing your own advertisements. This is especially helpful with Adsense, and easily integrated into Wordpress themes.

<?php
$hidden  = '192.255.255.255';
$userip = $_SERVER['REMOTE_ADDR'];
if($userip != $hidden){ print '
<p>
<script type="text/javascript"><!--
google_ad_client = "your-google-publisher-id-here";
//468x60, created 11/14/07
google_ad_slot = "111111111111";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>'; } ?>

Make sure you replace 192.255.255.255 with your own IP, and of course put in your own Adsense code, or whatever advertising network you’re using. This is guaranteed to NOT display your ads, eliminating the possibility of clicking them.

Additional Posts Worth Reading

 

Comments »

No comments yet.

Name (required)


E-mail (required - never shown publicly)


URI - Web Site Address






Subscribe

Site of The Day

Sponsors

Categories

Recent Comments

  • Arthur: I can’t even be an Ebay affiliate. Tried various ways but still declined. Any help or suggestions?
  • chicago web design: I can’t imagine that these will last very long before Google banishes them all. But for now...
  • D.Ksyte: Anyone involved with cron job scheduling might find this resource useful. Cron Sandbox at HxPI is an...
  • FoNiX: “…decode md5″ is not possible, only bruteforce: generate hash and compare with original.
  • Z@$#: plz plz decript this hash for me any one….its really important…. 2CAD28C7C619F27DDE7B83C4999795BA
  • Joe: Thanks for writing this up. I tried the second method…however after the debian install the screen looks...
  • Scott: Was this issue ever resolved? I just started having a problem a couple weeks ago. I don’t do any kind of...
  • Prashant Patel: I had integrated Sp3 in Xp But finding one problem. In the Task Manager Process windows many services...
  • Ed: This looks like a real ‘leet’ linux command but it misses the point. Why would a hacker keep the name of...
  • Sudesh: My account was disabled but I followed their guideline and in one sec it was back on :) Here is the...

Top Commentators

Miscellaneous

  • Add to Technorati Favorites