NULL, 'errors' => ''); $content = validator::__getContent($input); $http = new HttpClient('www.htmlhelp.com',80); $http->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207'); $http->useGzip(false); $http->setPersistReferers(false); $params = array('area' => $content,'charset' => $charset); if ($http->post('/cgi-bin/validate.cgi',$params) !== false) { $result = $http->getContent(); if (strpos($result,'
Congratulations, no errors!
')) { $res['valid'] = true; } else { $res['valid'] = false; if ($errors = preg_match('#');
}
}
return $res;
}
return false;
}
function __getContent($input)
{
return
''."\n".
''."\n".
''."\n".
'validation '."\n".
''."\n".
''."\n".
$input."\n".
''."\n".
'';
}
}
?>