从IE8发布到PHP会产生空白$ _POST [英] Posting from IE8 to PHP gives blank $_POST

查看:64
本文介绍了从IE8发布到PHP会产生空白$ _POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的HTML表单,向php脚本发送一个post请求。在IE8中,表单只能间歇性地工作 - 大多数时候PHP脚本看到一个空的$ _POST变量。



这是我的代码:

 < html> 
< head>
< title>测试后< / title>
< / head>
< body style =text-align:center;>
<?php

echo< pre>。print_r($ _ POST,TRUE)。< / pre>;

?>
< form action =<?php echo $ _SERVER ['PHP_SELF']?>方法= POST >
< input type =textname =name>
< input type =hiddenname =hiddenvalue =moo>
< input type =submitvalue =搜索>
< / form>
< / body>
< / html>

有时print_r会给出您期望的响应(即它填充了表单中的数据) ,大部分时间都是空的。



无法使用POST对于网络应用程序来说有点问题 - 任何人都知道发生了什么,以及如何修复它?

解决方案

感谢大家趟这个。



<事实证明问题出在我启用的Apache模块中。



这是一个允许apache使用Windows身份验证通过Windows用户ID识别用户的模块 - mod_auth_sspi



效果是由模块中的已知错误引起的,但是有一个简单的额外指令可以解决这个问题,直到下一次添加修复更新,如下所述:



http://sourceforge.net/projects/mod-auth-sspi / forums / forum / 550583 / topic / 3392037


I have a simple HTML form, sending a post request to a php script. In IE8, the form only works intermittently - most of the time the PHP script sees an empty $_POST variable.

Here's my code:

<html>
<head>
<title>Post test</title>
</head>
<body style="text-align: center;">
<?php

echo "<pre>".print_r($_POST, TRUE)."</pre>";

?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" name="name">
<input type="hidden" name="hidden" value="moo" >
<input type="submit" value="Search" >
</form>
</body>
</html>

Sometimes the print_r gives the response you'd expect (i.e. it's populated with the data from the form), most of the time it's empty.

Not being able to use POST is a bit of a problem for web applications - anyone got any ideas what's going on, and how to fix it?

解决方案

Thanks everyone for wading in on this one.

It turns out the problem lay in an Apache module I had enabled.

It's a module to allow apache to use Windows authentication to identify a user via their Windows User id - mod_auth_sspi

The effect is caused by a known bug, in the module, but with a simple extra directive this can be worked around, until a fix is added in the next update, as described here:

http://sourceforge.net/projects/mod-auth-sspi/forums/forum/550583/topic/3392037

这篇关于从IE8发布到PHP会产生空白$ _POST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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