How could i Block Proxy Access to my website?

Discussion in 'PHP' started by CuBz, Oct 1, 2007.

  1. #1
    I was wondering if it is possible to add a code to my site that would block people from accessing my website using an online proxy?

    Thanks
     
    CuBz, Oct 1, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #2
    
    
    <?php
    
    if (@fsockopen($_SERVER['REMOTE_ADDR'], 80))
    {
        exit('Proxies are not allowed.');
    }
    
    ?>
    
    PHP:
    That'll may block a few other users as well though. But I guess that's the only way unless you want to collect and compare all known proxy IPs.
     
    nico_swd, Oct 1, 2007 IP