QUERY_STRING from command line
| From: | Rajesh Batchu | Date: | Wed, 22 Sep 2004 05:16:53 +0000 |
| Subject: | QUERY_STRING from command line | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-197520@lists.php.net to get a copy of this message | ||
Hi,
I am working on a php script which is accessed as below
http://10.10.10.10/pageone.php?hellohowareyou
in the pageone.php i am accessing the variable $_SERVER["QUERY_STRING"
and i am getting the proper "hellohowareyou" as value.
All these days i was accessing this over the browser. But now i need to POST to this
page from command line. When i am usnig the below logic to post to this page, i am not
getting any value in the $_SERVER["QUERY_STRING".
--------------------------
$usepath="http://10.10.10.10/pageone.php";
$host="10.10.10.10";
$data="hellohowareyou";
$fp = fsockopen($host, 80, &$errno, &$errstr, 360);
fputs($fp, "POST $usepath HTTP/1.0\n");
$strlength = strlen($data);
fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
fputs($fp, "Content-length: " . $strlength . "\n\n");
fputs($fp, "?$data \n\n");
$output = "";
while (!feof($fp)) {
$output .= fgets($fp, 1024);
}
//print " out put is $output aaa <br> ";
//exit;
fclose($fp);
print $output."aaa\n";
--------------------
Can some one suggest me some solution..
Thanks in advance
Regards,
Rajesh B.
---------------------------------
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.