PHP script to block own ip

Discussion in 'AdSense' started by t0ny, Mar 3, 2007.

  1. #1
    Hello,

    I'm wondering if someone can help me and give me the php code with conditional to block Adsense ads from displaying to my own IP address.


    Please help, thank you.
     
    t0ny, Mar 3, 2007 IP
  2. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <?php
       if($_SERVER['REMOTE_ADDR'] != 'yourip')
       {
    ?>
    your ads here
    <?php } ?>
    
    Code (markup):
     
    giraph, Mar 3, 2007 IP
  3. Lordy

    Lordy Peon

    Messages:
    1,643
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Download Adblock plugin for firefox, you can block any adsense for any website.,
     
    Lordy, Mar 3, 2007 IP
  4. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I tried this and it didn't work with vbulletin.
    Do you have a different format?

    Like maybe something that looks like this:

    <if conditions="





    </if>
     
    t0ny, Mar 3, 2007 IP
  5. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Wow, thank you. I'll do a search for this right away.
     
    t0ny, Mar 3, 2007 IP
  6. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    adblock is not compatible with the latest Firefox version. This won't help me.

    I'd prefer the php code, thank you. :)
     
    t0ny, Mar 3, 2007 IP
  7. JoshuaGross

    JoshuaGross Peon

    Messages:
    411
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #7

    That's not PHP code. What he supplied is PHP code.
     
    JoshuaGross, Mar 3, 2007 IP
  8. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Oh wait, hmmmmmmm.....then I guess it's a script that I'm looking for.

    I'm currently using vbulletin and it accepts conditionals in that manner.

    I always thought it was php, oopss. Guess not.

    ok, then I need the conditional statements to block my own ip address. :)
     
    t0ny, Mar 3, 2007 IP
  9. giraph

    giraph Guest

    Messages:
    484
    Likes Received:
    27
    Best Answers:
    0
    Trophy Points:
    0
    #9
    
    <if condition="$_SERVER['REMOTE_ADDR'] != 'yourip'">
    your ads
    </if>
    
    Code (markup):
    Not sure if that will work, I don't use vbulletin.
     
    giraph, Mar 4, 2007 IP
  10. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It looks like it will work, thanks.

    I have the vbulletin manual, but it doesn't offer any support for blocking an ip address.

    I'll figure something, if not, I'll come back here:)

    Cheers.
     
    t0ny, Mar 4, 2007 IP
  11. t0ny

    t0ny Banned

    Messages:
    57
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Yes, it works perfectly, thanks bro. :)
     
    t0ny, Mar 4, 2007 IP
  12. JaheeM

    JaheeM Guest

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    How to make it for my ip range not only one ip adress Please
    Thanks
     
    JaheeM, Sep 5, 2011 IP