php表单为空,除非刷新重新提交

时间:2015-03-23 13:06:57

标签: php forms post page-refresh

我已经阅读过很多关于这个主题的帖子,但似乎都没有解决我的特定问题。

我已从表单中删除了所有php和html,并将其条带化为最低限度,以消除编码错误。

<form action="/profilesave.php" method="post">
    <input type="text" name="a" />
    <input type="text" name="b" />
    <input type="text" name="c" />
    <input type="text" name="d" />
    <input type="text" name="e" />

    <input type="submit" >
</form>

profilesave.php

<?php $data = file_get_contents('php://input'); ?>
<?php var_dump($data);?>
<?php var_dump($_POST);?>

结果:

  

string&#39;&#39; (长度= 0)

     

数组(大小= 0)   空

但是,如果我在页面上点击刷新,我会得到:

  

string&#39; a = test&amp; b = test&amp; c = test&amp; d = test&amp; e = test&amp; f = test&amp; g = test&amp; h = test&#39;   (长度= 55)

     

数组(大小= 8)
  &#39;一个&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; B&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; C&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; d&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; E&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; F&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39;克&#39; =&GT;字符串&#39;测试&#39; (长度= 4)
  &#39; H&#39; =&GT;字符串&#39;测试&#39; (长度= 4)

有谁能告诉我,我做错了什么?

感谢。

0 个答案:

没有答案
相关问题