2012-01-07 123 views
2

我的web应用程序(php,kohana 2.x)有问题,我真的不知道如何解决它。这只发生在一些用户身上,无论如何,我无法通过更改浏览器来复制它。通常情况下,登录表单的工作,但有时发送空后:表单发送空POST(有时)

language en_US 
2012-01-07 19:55:24 +01:00 --- info: Called login, but POST is empty. 
2012-01-07 19:55:24 +01:00 --- info: <pre>(array) Array 
(
) 
</pre> 
2012-01-07 19:55:24 +01:00 --- info: <pre>(array) Array 
(
) 
</pre> 

这就是表单代码:

<div id="form"> 

<form action="/index.php/user/login" method="post"> 
<input type="text" id="username" name="username" style="width:140px"> 
<input type="password" id="password" name="password" style="width:140px"> 
<input type="submit" id="submit" value="Enter" class="submit" />   
</form> 

</div> 

任何线索?

谢谢。

更新:用户再次遇到的问题:这是与信息的日志文件,你问一下:

2012-01-18 05:28:06 +01:00 --- info: ---------------------------------------- 
2012-01-18 05:28:06 +01:00 --- info: IP address: x.x.x.x 
2012-01-18 05:28:06 +01:00 --- info: Method: POST 
2012-01-18 05:28:06 +01:00 --- info: Type: application/x-www-form-urlencoded 
2012-01-18 05:28:06 +01:00 --- info: Length: 34 
2012-01-18 05:28:06 +01:00 --- info: Raw: username=xxx&password=yyy 
2012-01-18 05:28:06 +01:00 --- info: ---------------------------------------- 
2012-01-18 05:28:07 +01:00 --- info: ---------------------------------------- 
2012-01-18 05:28:07 +01:00 --- info: ---------------------------------------- 
2012-01-18 05:28:07 +01:00 --- info: IP address: x.x.x.x 
2012-01-18 05:28:07 +01:00 --- info: Method: GET 
2012-01-18 05:28:07 +01:00 --- info: Type: 
2012-01-18 05:28:07 +01:00 --- info: Length: 
2012-01-18 05:28:07 +01:00 --- info: Raw: 
2012-01-18 05:28:07 +01:00 --- info: ---------------------------------------- 

Apache的访问日志:

x.x.x.x - - [18/Jan/2012:05:27:47 +0100] "GET /media/images/template/table-bottom.png HTTP/1.1" 200 80034 "http://www.medieval-europe.eu/index.php/" "M 
ozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5. 
30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:27:47 +0100] "GET /media/images/template/background.jpg HTTP/1.1" 200 220187 "http://www.medieval-europe.eu/index.php/" "Mo 
zilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.3 
0729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:06 +0100] "POST /index.php/user/login HTTP/1.1" 302 782 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compati 
ble; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveCo 
nnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:07 +0100] "GET /index.php/region/view_announcements/region/106 HTTP/1.1" 302 602 "http://www.medieval-europe.eu/index.ph 
p/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CL 
R 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:07 +0100] "GET /index.php/user/login HTTP/1.1" 302 572 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatib 
le; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveCon 
nector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:08 +0100] "GET /index.php/ HTTP/1.1" 200 5854 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatible; MSIE 
8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1. 
3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:09 +0100] "GET /media/css/home.css HTTP/1.1" 304 241 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatible 
; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConne 
ctor.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:21 +0100] "GET /index.php/page/index HTTP/1.1" 200 5854 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/ 
4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:22 +0100] "GET /media/css/home.css HTTP/1.1" 304 241 "http://www.medieval-europe.eu/index.php/page/index" "Mozilla/4.0 (
compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Offic 
eLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:30 +0100] "POST /index.php/user/login HTTP/1.1" 302 782 "http://www.medieval-europe.eu/index.php/page/index" "Mozilla/4. 
0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Of 
ficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:30 +0100] "GET /index.php/region/view_announcements/region/106 HTTP/1.1" 302 602 "http://www.medieval-europe.eu/index.ph 
p/page/index" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.215 
2; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:30 +0100] "GET /index.php/user/login HTTP/1.1" 302 572 "http://www.medieval-europe.eu/index.php/page/index" "Mozilla/4.0 
(compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Off 
iceLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:31 +0100] "GET /index.php/ HTTP/1.1" 200 5854 "http://www.medieval-europe.eu/index.php/page/index" "Mozilla/4.0 (compati 
ble; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveCo 
nnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:32 +0100] "GET /media/css/home.css HTTP/1.1" 304 241 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatible 
; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConne 
ctor.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:42 +0100] "POST /index.php/user/login HTTP/1.1" 302 782 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compati 
ble; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveCo 
nnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:42 +0100] "GET /index.php/region/view_announcements/region/106 HTTP/1.1" 302 602 "http://www.medieval-europe.eu/index.ph 
p/" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CL 
R 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:43 +0100] "GET /index.php/user/login HTTP/1.1" 302 572 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatib 
le; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveCon 
nector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:43 +0100] "GET /index.php/ HTTP/1.1" 200 5854 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatible; MSIE 
8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1. 
3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:44 +0100] "GET /media/css/home.css HTTP/1.1" 304 241 "http://www.medieval-europe.eu/index.php/" "Mozilla/4.0 (compatible 
; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConne 
ctor.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:58 +0100] "GET /index.php/page/index HTTP/1.1" 200 5955 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/ 
4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:59 +0100] "GET /media/css/home.css HTTP/1.1" 200 4340 "http://www.medieval-europe.eu/index.php/page/index" "Mozilla/4.0 
(compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; Offi 
ceLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:59 +0100] "GET /media/images/flags-lang/gb.png HTTP/1.1" 200 921 "http://www.medieval-europe.eu/index.php/page/index" "M 
ozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5. 
30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
x.x.x.x - - [18/Jan/2012:05:28:59 +0100] "GET /media/images/flags-lang/it.png HTTP/1.1" 200 742 "http://www.medieval-europe.eu/index.php/page/index" "M 
ozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; EasyBits GO v1.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5. 
30729; OfficeLiveConnector.1.3; OfficeLivePatch.0.0)" 
+1

您是否在检查请求类型,例如'$ _SERVER ['REQUEST_METHOD']'?此行为最常见的情况是实际的POST被重定向,以便在下一个请求中最终得到一个空数组。 – Kemo 2012-01-07 19:07:16

+1

没有线索。这很难调试。设置自定义访问日志,或者在发生这种情况时注意$ _SERVER [“REQUEST_METHOD”]和CONTENT_LENGTH和_TYPE。 – mario 2012-01-07 19:08:01

+0

发生这种情况时'$ HTTP_RAW_POST_DATA'的内容是什么? – cmbuckley 2012-01-07 19:08:34

回答

0

我了解到,有一些浏览器插件出现在做用户正在访问的其他请求链接。

一个例子是铬插件,显示在地址栏中一些服务器标头,该插件被发送附加对服务器的请求来读取的标题信息,从而产生而不需要用户知道它的第二请求。我的网上银行和几个基于cookie的会话处理网站因此而破产。

要确定您的问题的根源,您需要进入尽可能多的数据尽可能像完整$ _ SERVER和$ _REQUEST数组的请求到该链接。为了更好地理解情况,您应该将分析与Web服务器日志文件结合起来,以查看在“空”提交之前由同一客户端发送到您的服务器的所有其他请求。

0

我不认为Kohana是在这里责怪。我已经看到了与Apache/PHP设置相同。在某些情况下,如果在服务器的请求中标题设置不正确,$ _POST为空。

看看从felixsigl这里的代码片段,以原始的HTTP输入转换为$ _ POST在这些情况下

PHP some $_POST values missing but are present in php://input

0

尝试添加“/”,形成行动:

<form action="/index.php/user/login/" method="post">