间歇性空$ _ POST问题 [英] Intermittent empty $_POST issue

查看:262
本文介绍了间歇性空$ _ POST问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的网站上,有时$ _ POST被传递空操作页面。

这里面有大概约1-2%的提交每天的表格。这是每一天当前约50-100腐败的表单提交。

我们有一定的数据是有最初的页面上。我们试图用$ _ POST,并在同一时间完全相同的价值$ _GET发送相同的数据。 $ _GET到达动作页面中的所有时间,但$ _ POST可以到空的。

很多时候,这个错误发生在WebKit的浏览器别谢季河。此外手机浏览器似乎更容易出现此。
IE浏览器遇到这种比WebKit浏览器少。
而很少正好到Firefox为好。

目前的配置是这样的:结果
PHP 5.2.15版本结果
CentOS 5的结果
阿帕奇2.2.3

有一件事情我们要讨论的是升级我们的PHP 5.3.x.
这听起来像一个合理的尝试?

这是我们如何尝试调试这个有什么建议?

更新:
提交形式如下:

 <形式的行动=submit.php receiver_user_id =< PHP的echo $ _SESSION ['receiver_user_id'];?>&安培; sender_user_id =< PHP的echo $ _SESSION ['USER_ID'];?>中方法=后>
  < textarea的名字=MESSAGE_TEXT>< / textarea的>
  <输入类型=隐藏的名字=receiver_user_idVALUE =< PHP的echo $ _SESSION ['receiver_user_id'];?>
  <输入类型=隐藏的名字=sender_user_idVALUE =< PHP的echo $ _SESSION ['USER_ID'];?>
  <输入类型=形象NAME =提交SRC =submit.pngVALUE =提交/>
< /表及GT;


解决方案

添加结果
< PHP的头?(连接:关闭); ?> 结果
 清在我们这边的问题。显然,这涉及到保活和IE浏览器。你可以阅读更多关于它在这里:
<一href=\"http://stackoverflow.com/questions/4796305/why-does-internet-explorer-not-send-http-post-body-on-ajax-call-after-failure\">Why它的Internet Explorer不能在Ajax调用发送HTTP POST正文失败后?

On our website, sometimes $_POST is relayed empty to the action pages.

This happens for roughly about %1-2 of the forms submitted on a daily basis. This is about 50-100 corrupt form submissions per day currently.

We are certain the data is there on the initial page. We tried sending the same data with $_POST and $_GET at the same time with the exact same values. $_GET reaches the action page all the time, but $_POST can arrive empty.

Often times, this error happens to Webkit besed browsers. Also mobile phone browser seem to be more prone to this. IE browsers experience this less than the Webkit browsers. And very rarely it happens to Firefox as well.

Current configuration is like this:
PHP Version 5.2.15
Centos 5
Apache 2.2.3

One thing we are discussing is to upgrade our PHP to 5.3.x. Does that sound like a reasonable try?

Any suggestions on how we can try to debug this?

UPDATE: Submission form is as follows:

<form action="submit.php?receiver_user_id=<?php echo $_SESSION['receiver_user_id'];?>&sender_user_id=<?php echo $_SESSION['user_id']; ?>" method="post">
  <textarea name="message_text" ></textarea>
  <input type="hidden" name="receiver_user_id" value="<?php echo $_SESSION['receiver_user_id'];?>
  <input type="hidden" name="sender_user_id" value="<?php echo $_SESSION['user_id']; ?>
  <input type="image" name="submit" src="submit.png" value="submit"/>
</form>

解决方案

Adding
<?php header("Connection: close"); ?>
cleared the problem on our end. Apparently this relates to keep-alive and IE. You can read more about it here: Why does Internet Explorer not send HTTP post body on Ajax call after failure?

这篇关于间歇性空$ _ POST问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆