File Unicode2html.php for phpCEDICT

<html>
<head>
<!-- charset=iso-8859-1 is important for the browser to convert the encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Pinyin to Unicode Converter</title>
</head>
<body>
<form action="unicode2html.php" method="post" name="convert">
	<div class="PostTitle">Pinyin to Unicode Converter</div>
	<textarea name="text" cols="800" rows="7" id="text"></textarea>
	<br />
	<input name="submit" type="submit" id="submit" value="Convert">
	<input name="reset" type="reset" id="reset" value="Reset">
</form>
<?php
if (isset($_POST['submit'])) 
{
	//Below is what outputs the information, it assumes the existence 
        //of header.html and footer.html, 
	//you will need to modify it or delete it according to your needs.
	$toconvert=$_POST["text"];
	$converted=$toconvert; //delete this
	//$converted=convert_to_unicode($toconvert);
	$converted = nl2br($converted);
	//echo("<div class='Post'>Unicode: <p>$converted</p>");
	$convertedhtml=str_replace("&#","&amp;#",$converted);
        //display the converted text as html
	echo ("Text for use in HTML:<p>$convertedhtml</p>"); 
}
 
?>
 
</body>
</html>
 
 
 
  code/cedictunicode2html.txt · Last modified: 2005/01/06 11:38
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki