我有以下代码。这在我的管理面板上用于管理员将其笔记放入其他管理员可以读取它。我不想将它存储在数据库中。窗体不保存到PHP文件
问题是表单没有保存文本在textarea中。
<?php
IF (ISSET($_POST["submit"])) {
$string = '<?php
$notes = "'. $_POST["notes"]. '";
?>';
$fp = FOPEN("includes/notes.php", "w");
FWRITE($fp, $string);
FCLOSE($fp);
echo '<div class="ok">' . $lang["done"] . '</div>';
}
include("includes/notes.php");
?>
<form action="" method="post" id="notesform">
<textarea placeholder="Admin notes" class="notes" id="notes"><?php echo $notes; ?></textarea>
<input type="submit" value="OK">
</form>
什么问题?我怎样才能解决这个问题?我曾在Google上尝试过大部分建议,但它一直在发生!
更改''转到''那么你先IF测试实际上会在'$ _POST'中找到按钮名称。 – RiggsFolly
顺便说一句:在camelcase中编写函数等是很可怕的。难以阅读的其他开发人员可以加入你的团队等。想想看。 –
@bub你的意思是大写.. camelCase就好.. –