사이트 내 전체검색
PHP
링크검사 (홈페이지 오픈여부 검사)
로빈아빠
https://cmd.kr/php/263 URL이 복사되었습니다.

본문

<?
$address = "$data[homepage]"; # 홈페이지주소
$port = 80; #확인할 포트번호
$out = "GET ".$the_path." HTTP/1.0\r\nHost: ".$host."\r\n\r\nUser-Agent: Mozilla/4.0 \r\n";
$fp = @fsockopen($address,$port,$errno,$errstr,15);


usleep(50);
if($fp) {
 socket_set_timeout($fp, 30);
 fwrite($fp, $out);
 $body = false;
 while(!feof($fp)) {
  $buffer = fgets($fp, 128);
  if($body) $content .= $buffer;
  if($buffer=="\r\n") $body = true;
 }
fclose($fp);
}
?>

댓글목록

등록된 댓글이 없습니다.

PHP
871 (3/18P)

Search

Copyright © Cmd 명령어 18.118.140.88