duankeng1911 2013-08-25 01:13
浏览 112

表单数据未发送到POST

This is ridiculous. My problem is as per the title. Trying to var_dump or print_r the $_POST superglobal yields an empty array.

Take a look at my form:

<form method="post" action="" class="login">
    <fieldset>
        <dl>
            <dt><label for="loginEmail">Email</label></dt>
            <dd><input type="email" id="loginEmail" name="loginEmail" maxLength="32" /></dd>

            <dt><label for="loginPassword">Password</label></dt>
            <dd><input type="password" id="loginPassword" name="loginPassword" maxlength="64" /></dd>

            <dt></dt>
            <dd><input type="submit" value="submit" class="button" /></dd>
        </dl>
    </fieldset>
</form>

I don't see anything wrong with it. The name attribute is intact, and I'm posting to the same page, yet POST continues to be empty. It's worth noting I have another form on another page with similar syntax which works.

For example:

if (!empty($_POST)) {
  echo '42';
}

Does not run.

Any ideas?

  • 写回答

3条回答 默认 最新

  • doudiza9154 2013-08-25 01:26
    关注

    Your form is pointing nowhere.. If you expect it to be the same page, then specify,

    <form action="{$_SERVER['SCRIPT_NAME']}">
    

    which will render the same page, but send the parameters. if you have a handler script somewhere, then specify the relative url.

    评论

报告相同问题?

悬赏问题

  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R
  • ¥15 在线请求openmv与pixhawk 实现实时目标跟踪的具体通讯方法
  • ¥15 八路抢答器设计出现故障