Several games have a suspision that the first game in the rankings right now is cheating somehow maybe with proxies. I have tried to block proxies with the following script, but it doesn't seem to work completely right and it is very slow. Does anyone know of a way to secure my vote script more than just checking the IP and setting a cookie?
PHP Code:
<?
$portcheck = array('80','81','128','3127','3128','6588','8000','8080','8081','8487','8888'); // Your list of comment ports. Remember not to many or script will fail.
$passproxy = array('localhost'); // I.P. address to let pass the check.
$blockhost = array(''); // Block a known host or I.P.
$nopass = "error message"; // If proxy is found and not on the pass list send them to the location you choose.
$SocketTimeout = 1; // 1 is about a 6 second wait. Higher the number longer the wait and more secure the check is.
if ((!in_array($REMOTE_ADDR, $blockhost)) && (!in_array($REMOTE_ADDR, $passproxy)))
{
$num = 0;
while ($portcheck[$num])
{
$fSockPointer = fsockopen($REMOTE_ADDR, $portcheck[$num], $errno, $errstr, $SocketTimeout);
if ($fSockPointer)
{
echo $nopass;
fclose($fSockPointer);
}
$num++;
}
}
else
{
if (in_array($REMOTE_ADDR, $passproxy))
{ die();
}
else
{
echo $nopass;
die();
}
}
?>
Bookmarks