작성일 : 11-07-07 13:58
글쓴이 :
기리 (123.♡.195.24)
조회 : 3,467
|
function socket() { $host ="HostName"; $port ="80"; $errno=""; $errstr=""; $data =""; $str=sprintf("GET http://DomainName/retur_page.php HTTP/1.0\n User-Agent: Mozilla/4.0\n\n",$data);
$fp = fsockopen($host, $port, &$errno, &$errstr, 5); if($fp) { fputs($fp,$str); while(!feof($fp)) { $contents.= fgets($fp,128); } fclose($fp); }
$pp=explode("\n",$contents);
if(!trim($pp[0])) return "Connect fail"; else return trim($pp[8]); } $online_chk = socket();
sleep(1); if($online_chk=="ok") { echo "<META HTTP-EQUIV=\"refresh\" ConTENT=\"0;URL=http://DomainName\">"; exit; }else{ echo "<META HTTP-EQUIV=\"refresh\" ConTENT=\"0;URL=http://DomainName\">"; exit; } exit;
|
|