[英]How do I access information entered in a form on html on the .php file?
I have tried plenty of methods already including ones on this site. 我已经尝试了很多方法,包括此站点上的方法。 The echo function works for the words on the .php file but it just ignores the form information.
echo函数适用于.php文件中的单词,但它只忽略表单信息。 Please could someone tell me where I am going wrong.
请有人告诉我我要去哪里错了。 I am using Google Chrome if that matters.
如果这很重要,我正在使用Google Chrome。 This is the .html file.
这是.html文件。
<!DOCTYPE HTML>
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
</html>
and this is the .php file named welcome.php 这是一个名为welcome.php的.php文件
<html>
<body>
Welcome <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>
</body>
</html>
and all it displays after entering information and clicking submit, all it displays is: 输入信息并单击提交后显示的所有内容是:
Welcome
Your email address is:
I would be very grateful if anyone can help. 如果有人可以帮助,我将不胜感激。 Thanks in advance.
提前致谢。
Say the page name, containing the form, is index.html. 说包含表单的页面名称是index.html。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.