0) $url = ""; if(!$url) { $url= $_GET['url']; } if(!$url) { $error = "URL not valid"; } $url = html_entity_decode($url); //$check = fsockopen($url, 80, $errno, $errstr, 3); if($url) { stream_set_timeout($handle, 2); $handle = fopen($url, "r"); // echo $xhtml = fread($handle, filesize($url)); // fclose($handle); if ($fd = @fopen($url,'rb')){ stream_set_timeout($fd, 5); $html = ''; while (!feof($fd)) { $xhtml .= fgets($fd); } fclose($fd); } /* while (!feof($handle)) { $xhtml .= fgets($handle, 4096); } */ //$xhtml = preg_replace("'.*?'si", "", $xhtml); $xhtml = preg_replace("''si", "", $xhtml); require_once('XhtmlValidator.php'); $XhtmlValidator = new XhtmlValidator(); if($XhtmlValidator->validate($xhtml) === false){ echo '

There are some errors on the XHTML page:

'; $XhtmlValidator->showErrors(); echo "

Showing XHTML code:


".$xhtml.""; }elseif(strlen($xhtml) > 1){ echo '

Valid XHTML!

Valid HTML 4.01 Strict To show your readers that you have taken the care to create an interoperable Web page, you may display this icon on any page that validates.
Here is the HTML you could use to add this icon to your Web page:

  <p>
    <a href="http://www.forumer.it/validator/xhtml.php"><img
        src="http://www.w3.org/Icons/valid-html401"
        alt="Valid HTML 4.01 Strict" height="31" width="88"></a>
  </p>

  
'; } } if(!$xhtml) { if(!$error AND $_GET['url']) { $error = "URL not valid"; } if(!$error) { $error = "No Referer header found!"; } echo '

Sorry! This document can not be checked:

'; echo "

$error

"; echo '

Download Gratis

'; } ?>