I am writing a script for mIRC that will fetch data from my webserver, that code is generated via PHP.
It works just fine when i connect via my browser (firefox). However, when i connect via the mIRC sockets, server fails to "compile" my PHP code. I can still able to fetch any other text or html. Seems like the webserver (litespeed) does not acknowledge my http requests(?!)
This is my header information that I pass to the server:
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
I've tried using a apache server instead of litespeed, but it doesn't solve either. I still don't get any PHP generated code to show.
Am i missing some headers? Should I do it in a completely different way?
update:
mIRC code:
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
}
}
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 that last "reponse: " i should get a php generated line with "reponse: true" the "reponse: " is just a prefix for my echo..