2013-05-02 1 views
1

PHP를 통해 생성 된 웹 서버에서 데이터를 가져올 mIRC 용 스크립트를 작성하고 있습니다.소켓을 통해 연결할 때 PHP 코드가 "컴파일"되지 않습니다.

내 브라우저 (firefox)를 통해 연결하면 정상적으로 작동합니다. 그러나 mIRC 소켓을 통해 연결하면 서버가 PHP 코드를 "컴파일"하지 못합니다. 다른 텍스트 나 html을 가져올 수 있습니다. 나는 아파치 서버 대신 사용하여 시도했다

sockwrite -n ccsw_sock_reg GET /ccsw/ccsw.php?action=register&username= $+ %ccsw_username_temp $+ &password= $+ %ccsw_username_temp HTTP/1.1 
    sockwrite -n ccsw_sock_reg Host: www.[HIDDEN].com 
    sockwrite -n ccsw_sock_reg Connection: close 
    sockwrite -n ccsw_sock_reg User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008052906 Firefox/3.0 
    sockwrite -n ccsw_sock_reg Accept-Encoding: gzip 
    sockwrite -n ccsw_sock_reg Accept:Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
    sockwrite -n ccsw_sock_reg Accept-Language: en-us,en;q=0.5 
    sockwrite -n ccsw_sock_reg Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7 
    ;sockwrite -n ccsw_sock_reg Cache-Control: no-cache 
    sockwrite -n ccsw_sock_reg Cache-Control: no-store, no-cache, must-revalidate 
    sockwrite -n ccsw_sock_reg Cache-Control: post-check=0, pre-check=0 
    sockwrite -n ccsw_sock_reg Pragma: no-cache 
    sockwrite -n ccsw_sock_reg $crlf 

: 내 HTTP 요청 (?!)

이 내가 서버에 전달 내 헤더 정보입니다 인정하지 않는 웹 서버 (LiteSpeed를)처럼 보인다 litespeed,하지만 그것도 해결되지 않습니다. 아직 PHP로 생성 된 코드가 표시되지 않습니다.

일부 헤더가 누락 되었습니까? 완전히 다른 방식으로해야할까요?

갱신 :

mIRC를 코드 :

alias testsock { 
    sockclose testsock 
    sockopen testsock www.[HIDDEN].com 80 
} 
on *:sockopen:testsock: { 
    sockwrite -nt testsock GET /ccsw/ccsw.php?action=register&username= $+ %ccsw_username_temp $+ &password= $+ %ccsw_username_temp HTTP/1.0 
    sockwrite -nt testsock Host: www.[HIDDEN].com 
    sockwrite -nt testsock $crlf 
} 

on *:sockread:testsock: { 
    %ccsw_content_start = 0 

    if ($sockerr > 0) return 
    sockread %temp 
    while ($sockbr) { 
    echo response: %temp 
    sockread %temp 
    } 
} 

응답 :

reponse: HTTP/1.0 200 OK 
reponse: Date: Thu, 02 May 2013 14:45:07 GMT 
reponse: Server: LiteSpeed 
reponse: Connection: close 
reponse: X-Powered-By: PHP/5.2.17 
reponse: Content-Type: text/html 
reponse: Content-Length: 43 
reponse: 

마지막 후 "reponse :"나는 "reponse와 PHP를 생성 선을 얻어야한다 : true " "응답 : "은 내 에코의 접두어입니다.

+2

당신이 어떤 응답을받을 수 있나요? 오류? 연결 해제? PHP 소스? 그리고 로그 (Apache와 PHP 로그 모두)를 확인 했습니까? –

+2

6 번 줄에는 'Accept : Accept :'가 두 번 나타 났습니까? –

+0

첫 번째 스톱은 항상 웹 서버의 액세스 로그와 오류 로그이어야합니다. 특히 아파치는 관련성이있는 모든 것을 기록한다. 첫 번째는 성공했을 때, 두 번째는 실패 할 때 기록한다. –

답변

0

주의 깊게 보면 다음과 같은 응답 헤더가 표시됩니다.
"Content-Length : 43"
즉 응답을 얻었으며 문제는 SOCKREAD 이벤트 내에 있습니다.

이 다음 코드를보십시오 : PHP 파일을 요청할 때

on *:sockread:testsock: { 
    if ($sockerr) { 
    return 
    } 

    var %line 
    :start 
    sockread %line 
    if (%line) { 
    echo -ag SOCKREAD: %line 
    } 
    if ($sockbr) { 
    goto start 
    } 
}