Posted By

pgmr on 03/19/09


Tagged

block users proxy


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

pgmr
lajevardi


Block proxy users from your site


 / Published in: PHP
 

URL: http://www.pgmr.co.uk

Checks browser headers to see if the user is on a proxy and stops them from viewing whatever page you want. Just call the function at the top of the page. www.pgmr.co.uk for more ;)

  1. <?php
  2.  
  3. /**
  4.  * Block Proxy Script
  5.  * Copyright 2009 - www.pgmr.co.uk - [email protected]
  6.  */
  7.  
  8. function checkProxy {
  9. if($_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_CLIENT_IP'] || $_SERVER['HTTP_VIA']) {
  10. die('No proxies allowed');
  11. }
  12. }
  13.  
  14. ?>

Report this snippet  

You need to login to post a comment.