rbawaskar at gmail dot com
08-Mar-2009 06:17
Found this script after much despair, should be useful to lot of people.
To submit a form using POST method through PHP, just add the data to be posted as header. This essentially saves one extra html page sent to the browser when user has to be redirected. Mostly found this technique useful for redirecting to payment gateways.
$host = "www.example.com";
$path = "/path/to/script.php";
$data = "data1=value1&data2=value2";
$data = urlencode($data);
header("POST $path HTTP/1.1\r\n" );
header("Host: $host\r\n" );
header("Content-type: application/x-www-form-urlencoded\r\n" );
header("Content-length: " . strlen($data) . "\r\n" );
header("Connection: close\r\n\r\n" );
header($data);
?>
--
map{ map{tr|10|# |;print} split//,sprintf"%.8b\n",$_}
unpack'C*',unpack'u*',"5`#8<3'X`'#8^-@`<-CPP`#8V/C8`"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment