单击提交查询按钮时,它应该显示用户输入的信息,但这里没有发生。错误在哪里? 这是html代码:
<html>
<body>
<form method="post" action="temp2.php">
Name: <input type="text" name="name" ><br>
E-mail: <input type="text" name="e-mail" ><br>
<input type="submit" >
</form>
</body>
</html>`
和 temp2.php 文件:
<html>
<body>
Name: <?php echo $_POST["name"]; ?><br>
E-mail: <?php echo $_POST["e-mail"]; ?><br>
</body>
</html>
This is the image of the output when Submit button is clicked.
最佳答案
(现在我们知道这里没有发生什么)
操作:
"I had those files in php folder and not in htdocs folder. It's up and running now, thank you everyone."
使用错误报告会向您发出有关未找到该文件/文件夹的通知。
我很早就在评论区指出过这一点。
编码时最好的选择是首先检查文件夹/文件是否存在于条件语句中。
并检查您的输入是否已设置/不为空:
关于PHP - 表单处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33462789/