【发布时间】:2011-04-04 02:35:06
【问题描述】:
我不能让这个脚本工作!我还需要这样做,以便 onload 用户将在 textarea 中。请帮忙?
<?php
//the path to any file
$fn = "test.txt";
if (isset($_POST['content'])) {
$content = stripslashes($_POST['content']);
$fp = fopen($fn, "w") or die("Error opening file in write mode!");
fputs($fp, $content);
fclose($fp) or die("Error closing file!");
}
?>
<form action="<?php echo $_SERVER["PHP_SELF"] ?>" method="post">
<textarea style="font-family: Marker Felt; font-size: 16px; background-color: transparent; border: none; height:159px; resize: none;" id="myDiv"><?php readfile($fn); ?></textarea>
<br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/>
<br/>
<input type="submit" value="Save">
</form>
【问题讨论】: