//----------------------------------------------------------------
//IsProxy                                                        FUNCTION
//----------------------------------------------------------------
//      What it does -
//                  Checks against public lists of blacklisted
//            proxy addresses to make sure that $IP isn't one of
//            them.
//
//      Changes -
//            [2006/12/07] - RaX :: Created.
//----------------------------------------------------------------
function IsProxy($IP)
{
        $Result = FALSE;//Innocent until proven Guilty

        $BlackList = array(     'http.dnsbl.sorbs.net',
                                        'misc.dnsbl.sorbs.net',
                                        'socks.dnsbl.sorbs.net',
                                        'proxies.blackholes.easynet.nl',
                                        'list.dsbl.org'
                                 );

        if (preg_match("/([0-9]+).([0-9]+).([0-9]+).([0-9]+)/", $IP, $Matches))
         {
                foreach ($BlackList as $Server)
                {
                        echo $Server;
                        $ServerHost = $Matches[4] . "." . $Matches[3] . "." . $Matches[2] . "." . $Matches[1] . "." . $Server;
                        $Resolved = gethostbyname($ServerHost);
                        if ($Resolved != $ServerHost)
                        {
                                $Result = TRUE;//GUILTY!
                                break;
                        }
                }
         }
        return $Result;
}
//-----------------------------------------------------------------