<?
php

function urlExists($url) 
{ 
$url = ereg_replace("http://","", $url); 
list($domain, $file) = explode("/", $url, 2); 
$fid=fsockopen($domain,80); 
fputs($fid,"GET /$file HTTP/1.0rnHost: $domainrnrn"); 
$gets = fgets($fid, 1024); 
fclose($fid); 
if (ereg("HTTP/1.1 200 OK", $gets)) return TRUE; 
else return FALSE; 
} 

$TargetURL = "http://sir.co.kr/main/gnuboard4/"; 
$explodeURL = parse_url($TargetURL); 
$domainURL = $explodeURL[scheme]."://".$explodeURL[host]; 


$result = urlExists($TargetURL); 

if($result) { echo("페이지가 존재함."); } 
else { echo("페이지가 존재하지않음."); } 
?>