duanpuchen3142 2013-11-01 22:19
浏览 44
已采纳

html电子邮件中的表单POST在PHP中看不到变量

i send an HTML email with a form and a button like this:

<form action="http://myurl/index.php" method="post">
<input type="hidden" name="testing" value="123456">
<button  class="btn" type="submit">SEND</button>
</form>

then in my index.php page i read the testing variable, in this way:

echo $_POST['testing'];

but i can't read the variable and give me this:

Notice: Undefined index: testing

there is a way to send a variabile from an html mail to a php page?

  • 写回答

3条回答 默认 最新

  • dongtang8678 2013-11-01 22:32
    关注

    Oh. Got that Email Part now.

    Most Mail-Programs won't do POST requests, for security/privacy reasons. Use GET here:

    in HTML: <a href="http://myurl/index.php?testing=123456">SEND</a>
    and in PHP: echo $_GET['testing']

    Of course the data is visible in that case - but that's the entire point.

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

报告相同问题?

悬赏问题

  • ¥15 已知平面坐标系(非直角坐标系)内三个点的坐标,反求两坐标轴的夹角
  • ¥15 webots有问题,无响应
  • ¥15 数据量少可以用MK趋势分析吗
  • ¥15 使用VH6501干扰RTR位,CANoe上显示的错误帧不足32个就进入bus off快慢恢复,为什么?
  • ¥15 大智慧怎么编写一个选股程序
  • ¥100 python 调用 cgps 命令获取 实时位置信息
  • ¥15 两台交换机分别是trunk接口和access接口为何无法通信,通信过程是如何?
  • ¥15 C语言使用vscode编码错误
  • ¥15 用KSV5转成本时,如何不生成那笔中间凭证
  • ¥20 ensp怎么配置让PC1和PC2通讯上