<?php
$fp = fsockopen("1.2.3.4", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = 'POST /report/check123.jsp HTTP/1.1
Host: 1.2.3.4
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: vi,en-us;q=0.7,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: UTF-8,*
Keep-Alive: 115
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 69
txtUsername=huypv&txtPassword=zz&btnLogin=%C4%90%C4%83ng+nh%E1%BA%ADp';
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
Title:
Use fsockopen send raw http request
Description:
<?php $fp = fsockopen("1.2.3.4", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; ...
...
Rating:
4