我一直在尝试制作一个简单的建议框
来自.html网页的HTML
<form action="suggestions.php">
Suggest some content for this page: <input type="text" name="suggestion"></br>
</br>
<input type="submit">
</form>
来自suggestions.php网页的PHP
<?php
$filename = date('Format String');
$Content = $_POST["suggestion"];
file_put_contents('./suggestions/'.$filename, $Content);
?>
它应该做什么
答案 0 :(得分:2)
默认表单方法是GET
。您需要在表单标记中使用method="POST"
,如下所示:
<form action="suggestions.php" method="POST">
Suggest some content for this page: <input type="text" name="suggestion"><br>