Created
April 30, 2013 11:29
-
-
Save oott123/5488135 to your computer and use it in GitHub Desktop.
PHP代理检测
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function isproxy(){ | |
$ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788); | |
foreach ($ports as $port){ | |
$sd = @fsockopen($_SERVER["REMOTE_ADDR"], $port, $errno, $errstr, 1); | |
if ($sd){ | |
fclose($sd); | |
return true; | |
} | |
} | |
return false; | |
} | |
//用法: | |
//if(isproxy())die('请勿使用代理申请!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment