Forum Moderators: coopster

Message Too Old, No Replies

Remove Adsense code with PHP

Removing the Adsense code for my own ip

         

rubenski

9:36 am on May 26, 2004 (gmt 0)

10+ Year Member



Hi there,

My web pages have Adsense ads on them. I want the Adsense ads NOT to appear when the user ip == my ip, so people on my network won't get to see the ads and consequently won't be able to click them.

Is there a way to do this with PHP? All it has to do really is look for the <script> </script> tags and remove them and everythinh in between. Could anyone help me with this?

dcrombie

11:17 am on May 26, 2004 (gmt 0)



Seems pretty trivial - is this what you want?

<?PHP 
if ($REMOTE_ADDR != $localipnumber) {
?>
// adsense code //
<?PHP
}
?>