【发布时间】:2013-12-15 03:08:29
【问题描述】:
在“index.php”页面上,我有以下html:
<form class="centerd" method="post" action="upload.php" enctype="multipart/form-data">
<textarea id="html" type="text" name="html-text"></textarea>
<input type="submit" value="upload"/>
</form>
在“upload.php”页面上,我有以下PHP代码:
<?php
file_put_contents("/files/test.html", htmlspecialchars($_POST['html-text']));
?>
<h1>From the textbox:</h1>
<? echo htmlspecialchars($_POST['html-text']); ?>
我希望文本框中的文本显示在 <h1> 标记之后,并且我希望创建 /files/test.html(/files/ 已经存在),并将文本框中的文本放入 @987654326 @文件。
实际发生的情况是,文本框中的任何内容都显示在 <h1> 标记之后,但从未创建 /files/test.html。
【问题讨论】: