一個可以擷取網站地理位置,伺服器作業系統php_PHP教程

來源:互聯網
上載者:User
’; $s2 = ‘\<\/table\>’; $tmp = array(); preg_match_all(“/”.$s1.”([^~]*?)”.$s2.”/i”,$data,$tmp); $tmp1 = array(); preg_match_all(“/\([^~]*?)\<\/li\>/i”,$tmp[0][0],$tmp1); return $tmp1[0][0].$tmp1[0][1].$tmp1[0][2];}function getsoft($host,$port){ $fp = @fsockopen($host,$port,&$errno,&$errstr,3); if(!$fp) return ‘unknown’; $get = “GET / HTTP/1.1\r\nHost:”.$host.”\r\nConnection: Close\r\n\r\n”; @fputs($fp,$get); $data = ”; while ($fp && !feof($fp)) $data .= fread($fp, 1024); @fclose($fp); $array = explode(“\n”,$data); $k = 2; for($i = 0;$i < 20;$i++) { if(stristr($array[$i],’Server’)){$k = $i; break;} } if(!stristr($array[$k],’Server’)) return ‘unknown’; else return str_replace(‘Server’,'伺服器軟體’,$array[$k]);}function ping($host,$port){ $time_start = microtime_float(); $ip = gethostbyname($host); $fp = @fsockopen($host,$port,&$errno,&$errstr,1); if(!$fp) return ‘Request timed out.
’.”\r\n”; $get = “GET / HTTP/1.1\r\nHost:”.$host.”\r\nConnection: Close\r\n\r\n”; @fputs($fp,$get); @fclose($fp); $time_end = microtime_float(); $time = $time_end – $time_start; $time = ceil($time * 1000); return ‘Reply from ‘.$ip.’: time=’.$time.’ms
’;}if(isset($_POST['url']) && isset($_POST['duankou'])){ echo ip138($host).’

’; echo ‘’.getsoft($host,$port).’

’; echo ‘Pinging ‘.$host.’ ['.gethostbyname($host).'] with Port:’.$port.’ of data:

’.”\r\n”; ob_flush(); flush(); for($i = 0;$i < $num;$i++) { echo ping($host,$port); ob_flush(); flush(); sleep(1); }}?>

http://www.bkjia.com/PHPjc/477868.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477868.htmlTechArticle?php error_reporting(E_ERROR); header(content-Type: text/html; charset=gb2312); set_time_limit(120); $host = isset($_POST[url]) ? chop(str_replace(http://,,$_POST[url])) : www.2cto....

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.