Hey, we all love and use proxies.
BUT... does anybody know a foolproof way to block a person using a Proxy Service from actually entering a website?
<?php
if (
$_SERVER['HTTP_X_FORWARDED_FOR']
|| $_SERVER['HTTP_X_FORWARDED']
|| $_SERVER['HTTP_FORWARDED_FOR']
|| $_SERVER['HTTP_CLIENT_IP']
|| $_SERVER['HTTP_VIA']
|| in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554)))
{
print "No proxies pls!";
} else{
print "OK";
}
?>
Run a proxy test (like the one http://web.freerk.com/proxyjudge/azenv1.04_27Apr05.zip) against the visitor, if they show up with something in their HTTP-Forwarded-By field that isn't their real ip, redirect them to somewhere else.
That's just off the top of my head, I think it should at least clear out the people who are doing it badly. People using a halfway-decent proxy will be mostly undetectable with standard means unless you do something fancier, like check cookies to see if the IP has changed for a single user.
N
Parse error: syntax error, unexpected T_BOOLEAN_OR in /home/drum/public_html/noprox.php on line 9
I use this:
Code:<?php if ( $_SERVER['HTTP_X_FORWARDED_FOR'] || $_SERVER['HTTP_X_FORWARDED'] || $_SERVER['HTTP_FORWARDED_FOR'] || $_SERVER['HTTP_CLIENT_IP'] || $_SERVER['HTTP_VIA'] || in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))) || @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30)) { print "No proxies pls!"; } ?>