01.
$fp
=
fsockopen
(
$host
,80);
02.
if
(!
$fp
) {
03.
echo
"<script> alert('socket error'); window.history.go(-1); </script>\n"
;
04.
exit
();
05.
}
06.
fputs
(
$fp
,
"POST $path HTTP/1.1\n"
);
07.
fputs
(
$fp
,
"Host: $host\n"
);
08.
fputs
(
$fp
,
"Referer: $referer\n"
);
09.
fputs
(
$fp
,
"Content-type: application/x-www-form-urlencoded\n"
);
10.
fputs
(
$fp
,
"Content-length: "
.
strlen
(
$data_to_send
).
"\n"
);
11.
fputs
(
$fp
,
"Connection: close\n\n"
);
12.
fputs
(
$fp
,
"$data_to_send\n"
);
13.
while
(!
feof
(
$fp
)) {
14.
$res
.=
fgets
(
$fp
, 128);
15.
}
16.
fclose(
$fp
);