|
|
发表于 8-2-2010 11:21 AM
|
显示全部楼层
回复 1# WaterBird90
learn the html tag --> form, textarea and iframe plus PHP is enough to create simple tryIt editor like w3schools:
index.html:
<html>
<head>Try it Editor</head>
<body>
<form method="post" action="main.php" target="result">
<b>Welcome to TryIt Application</b>
<br>
<input type="submit" value="Edit and Click Me " name="getResult" id="getResult"/><br>
<table>
<tr><td>
<textarea rows="23" cols="42" id="source" name="source">
<html>
<body>
<h1>hahahaha</h1>
</body>
</html>
</textarea>
</td><td>
<iframe id="result" src="main.php" height="350px" name="result"></iframe>
</td></tr></table>
</form>
</body>
</html>
PHP, main.php:
<?php
if(isset($_POST["getResult"])){
echo $_POST["source"];
}else{
echo "<h1>hahahaha</h1>";
}
?>
That's it. Please install apache to run the PHP apps |
|