dongmiyu8979 2017-12-09 23:01
浏览 36
已采纳

从HTML表单到PHP的数据[重复]

i have my HTML file:

<form action="input_db.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

and PHP file in the same directory:

Welcome <?php echo $_GET["name"]; ?><br>
Your email address is: <?php echo $_GET["email"]; ?>

Both running on a "UniServer Zero XIII" on my local windwos maschine

the problem is that the echo just not work

https://www.w3schools.com/php/php_forms.asp its this example from w3schools

</div>
  • 写回答

2条回答 默认 最新

  • dotelauv682684 2017-12-09 23:04
    关注

    You sending the data in form with the "POST" method and you trying to get it with $_GET variable;

    you can edit the form method to "get" :

    <form action="input_db.php" method="get">
    

    Or try to get the data with the $_POST["name"] variable

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 matlab有限元法求解梁带有若干弹簧质量系统的固有频率
  • ¥15 找一个网络防御专家,外包的
  • ¥100 能不能让两张不同的图片md5值一样,(有尝)
  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线
  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口