i'm trying to send an http post request and see if the server got it
correctly. i'm sending the http post request with this script:
<?
$address = 'domain.tld';
$port = 80;
$proxy = fsockopen("tcp://$address", (int) $port, $errno, $errstr, 1);
$extra = "extra=blah&this=test";
fputs($proxy,"POST /test.php HTTP/1.0\r\n");
fputs($proxy,"Host: $address\r\n");
fputs($proxy,"Content-Length: ".strlen($extra)."\r\n\r\n");
fputs($proxy,"$extra\r\n");
while (!feof($proxy))
print fgets($proxy);
fclose($proxy);
?>
test.php's contents are as follows:
<?
print_r($_POST);
?>
this is what i want to see:
Array
(
[extra] => blah
[this] => test
)
this is what i am seeing:
Array
(
)
any ideas as to what i'm doing wrong and how i can fix it? thanks!