PHP code doesnt "compile" when connecting via sockets -
i writing script mirc fetch data webserver, code generated via php.
it works fine when connect via browser (firefox). however, when connect via mirc sockets, server fails "compile" php code. can still able fetch other text or html. seems webserver (litespeed) not acknowledge http requests(?!)
this header information pass server:
sockwrite -n ccsw_sock_reg /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
i've tried using apache server instead of litespeed, doesn't solve either. still don't php generated code show.
am missing headers? should in different way?
update:
mirc code:
alias testsock { sockclose testsock sockopen testsock www.[hidden].com 80 } on *:sockopen:testsock: { sockwrite -nt testsock /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 } }
response:
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:
and after last "reponse: " should php generated line "reponse: true" "reponse: " prefix echo..
if see following response header
"content-length: 43"
means getting response , problem lies inside sockread event.
try following code:
on *:sockread:testsock: { if ($sockerr) { return } var %line :start sockread %line if (%line) { echo -ag sockread: %line } if ($sockbr) { goto start } }
Comments
Post a Comment