채팅 응용 프로그램에 로그인하고 사용자에게 메시지를 보내는 봇 응용 프로그램을 개발 중입니다. 응용 프로그램 자체가 주기적으로 Ajax 요청을 보내 온라인 사용자를 검색하고 사용자 목록을 매력과 같은 json 개체로 반환합니다. 내가 불을 지르고 콘솔에서 요청을 다시 경우에도 수동으로 다시 잘 작동하지만 내가 불을 지르고에서 컬로 요청을 복사하고 curl 명령 엔진을 보낼 때 요청이 성공적으로 전송하지만 난 서버에서 데이터베이스 오류를 줄 :cURL 요청이 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
I 방화 광에서 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'
일부 코드가 표시됩니다! –
내가 뭔가를 추가했습니다. 감사합니다. – CoderInNetwork