Location: PHPKode > scripts > CriosWeb_HTML_Cleaner > crioswebhtmlcleaner/index.php
<?php /* Created on: 12.07.2007 */ ?>
<html>
<head>
	<title>HTMLCleaner :: Clean MS Word HTML quickly</title>
	<style type="text/css">
		body,table	{font-family:tahoma,verdana,arial;font-size:9pt}
	</style>
</head>
<body>
<h2>CRIOS<i>WEB</i>'s HTMLCleaner</h2>
<form enctype="multipart/form-data" method="POST" action="<?$_SERVER['PHP_SELF']?>">
Upload HTML Document to be cleaned:
	<input type="file" name="doc"> or paste your code here:
	<br><br>
	
	<textarea name="html" rows="20" cols="80"></textarea>
	
	<br><br>	
	<input type="submit" value="Process" name="process">
</form>
<p>HTML source code cleaner (great help for cleaning MS Word content)</p>
<p>PHP class: <a href="http://luci.criosweb.ro/blog/2007/08/04/html-cleaner/" target="_blank">http://luci.criosweb.ro/blog/2007/08/04/html-cleaner/</a></p>

<p>Licenced under Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported<br>
(<a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">http://creativecommons.org/licenses/by-nc-sa/3.0/</a>)<br>
for personal, non-commercial use</p>

<p>For commercial use one developer licence costs 15 EUROs</p>
<?php
$word = @$_POST['html'];
if(isset($_POST["process"])){

	require("HTMLCleaner.php");
	
	if(!$word){
		$filename = $_FILES["doc"]["tmp_name"];
		
		$fp = fopen($filename,"r");
		$word = fread($fp,filesize($filename));
		fclose($fp);
		unlink($filename);
	}
	
	$cleaner = new HTMLCleaner();
	
	//$cleaner->Options['UseTidy']=false;
	//$cleaner->Options['OutputXHTML']=false;
	
	$cleaner->html = $word;
	$t0 = array_sum(explode(' ', microtime()));
	$cleanHTML=$cleaner->cleanUp('latin1');
	$t1 = array_sum(explode(' ', microtime()));
	$t = $t1 - $t0;
	echo "<p style=\"color:#006633\">Cleaned by <b>CRIOSWEB HTMLCleaner</b> version <b>$cleaner->Version</b> in $t seconds.</p>";
	echo '<textarea style="width:100%;height:300px">'.htmlspecialchars($cleanHTML,ENT_COMPAT,"ISO-8859-1")."</textarea>";
	echo $cleanHTML;
}
?> 
</body>
</html>
Return current item: CriosWeb_HTML_Cleaner