1

チャット アプリケーション (et チャット) にログインしてユーザーにメッセージを送信するボット アプリケーションを開発しています。アプリケーション自体は定期的に Ajax リクエストを送信してオンライン ユーザーを取得し、ユーザー リストを魅力的な json オブジェクトとして返します。firebug コンソールでリクエストを手動で再送信しても、再び正常に動作しますが、firebug でリクエストを cURL としてコピーし、cURL コマンド エンジンで送信すると、リクエストは正常に送信されますが、サーバーからデータベース エラーが発生します。

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

サーバーへのこの2つの同じリクエストに違いはないと思うので、2つの異なる応答を得るべきではないと思うので、非常に奇妙です。

より多くの情報を提供しても問題の発見に役立つとは思いませんが、より多くの情報が必要であることをお知らせいただければ幸いです。

ありがとう

EDIT:リクエストがブラウザで正常に送信され、有効な回答を受信したときのリクエストおよびレスポンスヘッダーは次のとおりです。

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

firebug で copy as cURL メニューを使用すると、以下のコードが返されます。

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'
4

1 に答える 1

-1

私には、cURLには参照するURLがないように思われます。それが非オブジェクトである理由です

于 2013-10-02T14:32:07.907 に答える