2012-01-07 122 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">