2013-10-02 67 views
1

我開發登錄到一個聊天應用程序殭屍程序(等聊天)和向用戶發送消息。 應用程序本身定期發送Ajax請求以檢索在線用戶,並將用戶列表作爲json對象返回,就像魅力一樣。 甚至當我重新發送螢火控制檯請求手動將其再次工作良好,但是當我在Firebug複製請求作爲捲曲並與捲曲命令引擎發送請求發送成功,但我給一個數據庫錯誤,從服務器:要求從螢火複製爲捲曲請求不起作用

Array 
(
    [0] => 42000 
    [1] => 1064 
    [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 
) 
SELECT ekhraj FROM db1_etchat_user where etchat_user_id = 
Fatal error: Call to a member function fetchAll() on a non-object in /home/mokhtal/domains/mokhtal.com/public_html/class/ConnectDB.class.php on line 76 

這很奇怪,因爲我認爲這兩個相同的請求與服務器沒有任何區別,所以我不應該得到兩個不同的迴應。

我不認爲提供更多信息,可以幫助發現問題,但如果你告訴我,需要更多的信息,我會感激。

感謝

編輯:當所述請求與瀏覽器正常地發送和接收有效的回答的請求和響應標頭是:

Response Headers 
Cache-Control no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0 
Connection close 
Content-Type application/json; charset=utf-8 
Date Wed, 02 Oct 2013 14:23:53 GMT 
Expires Thu, 19 Nov 1981 08:52:00 GMT 
Pragma no-cache 
Server lighttpd/1.4.28 
Transfer-Encoding chunked 
X-Powered-By PHP/5.3.27 
Request Headers 
Accept text/javascript, text/html, application/xml, text/xml, */* 
Accept-Encoding gzip, deflate 
Accept-Language en-US,en;q=0.5 
Content-Length 18 
Content-Type application/x-www-form-urlencoded; charset=UTF-8 
Cookie PHPSESSID=q0guk9lf3d2gb0lgs2ebejhb72; db1_cookie_test=1380723404; cookie_last_login=1380723823; cookie_anzahl_logins_in_XX_sek=1 
Host mokhtal.com 
Referer http://mokhtal.com/?Chat 
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 
X-Prototype-Version 1.7 
X-Requested-With XMLHttpRequest 

和POST參數是:

reloadsequenz=4000 

當我使用副本的螢火捲曲菜單,它返回下面的代碼:

curl 'http://mokhtal.com/?ReloaderUserOnline' -H 'Accept: text/javascript, text/html, application/xml, text/xml, */*' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.5' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Cookie: PHPSESSID=q0guk9lf3d2gb0lgs2ebejhb72; db1_cookie_test=1380723404; cookie_last_login=1380723823; cookie_anzahl_logins_in_XX_sek=1' -H 'Host: mokhtal.com' -H 'Referer: http://mokhtal.com/?Chat' -H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0' -H 'X-Prototype-Version: 1.7' -H 'X-Requested-With: XMLHttpRequest' --data 'reloadsequenz=4000' 
+0

顯示一些代碼! –

+0

我添加了一些東西。謝謝 – CoderInNetwork

回答

-1

對我來說似乎cURL沒有網址可以參考它爲什麼它的非對象

+1

你能解釋更多關於這個以及我應該如何解決它嗎? – CoderInNetwork

+0

你可以發佈你發送curl請求的代碼嗎?現在我只能看到輸出,所以很難看到輸入錯誤在哪裏 – epikfaal