PHP表单提交后用POST得不到数据

figowhf 2008-11-02 08:34:51
为什么我提交表单后,只有$username能得到数据,后面的$pw、$rpw等都得不到数据,是空的?
<?php
$username=trim($_POST['r_name']);
$pw = trim($_POST['password']);
$rpw=$_POST['r_password_r'];
$email=$_POST['r_email'];
$realname=$_POST['r_realname'];
........
?>

<html>
....
<form name=....>
.....
<input name="r_name" type="text" id="r_name" size="30" maxlength="20">
......
<input name="password" type="password" id="password" size="20" maxlength="20">
...
...全文
213 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
setimouse 2008-11-03
  • 打赏
  • 举报
回复
<html>
....
<form name=....>
.....
<input name="r_name" type="text" id="r_name" size="30" maxlength="20" />
......
<input name="password" type="password" id="password" size="20" maxlength="20" />
...
figowhf 2008-11-03
  • 打赏
  • 举报
回复
谢谢大家的解答,问题已经解决了,我将session_start()放到最顶端后,数据都接收过来了,为什么是这样,我也不懂
Mlive 2008-11-03
  • 打赏
  • 举报
回复
如果不想安装httpwatch就把POST的值全都打印出来看看,有没有传到后台.
Mlive 2008-11-03
  • 打赏
  • 举报
回复
你可以试试httpwatch这个监控的IE小工具,安装在IE上就可以了.
从这上面可以看到POST数据有没有传到后台.
或都是看看有没有定义form的method属性.
<form action="" name="mypost" method="POST">
...
wstonea 2008-11-03
  • 打赏
  • 举报
回复
没遇到过遇到首先检查 method="post"
然后再 print_r($_POST); 看结果。
程序猿之殇 2008-11-03
  • 打赏
  • 举报
回复
extract($_POST);
看一下哈.
letian003 2008-11-03
  • 打赏
  • 举报
回复
我也没出现过

先搞清楚,数据提交过去,到底是get还是post方法
solo55555 2008-11-03
  • 打赏
  • 举报
回复
<html>
....
<form name=.... method="post">
.....
<input name="r_name" type="text" id="r_name" size="30" maxlength="20">
......
<input name="password" type="password" id="password" size="20" maxlength="20">
...
你的表单没有采用post方法,请你在设置表单时在属性中设置方法为post,即method="post",试试看!我从来没出现过这种情况!
gsweb 2008-11-02
  • 打赏
  • 举报
回复
我也遇到了类似的问题,注册登陆成功,但数据库里看不到数据记录。同问?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧