Hi,
This is M H Rasel from Bangladesh. I am trying to redirect to another page with some variable as POST variable. i try to use the following code for doing that.
<?php
$host = "www.acmbeginner.org/";
$path = "/action.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);
?>
i save this code as index.php and i develop the action.php as redirect page. i host this script also on the domain acmbeginner.org . But when i run the script i get an internal Server Error like following
[CENTER]The server encountered an unexpected condition which prevented it from fulfilling the request.
The script did not produce correct headers. It must at least print out a Content-Type header, like so:
Content-Type: text/html
The header the script produced was:
POST /action.php HTTP/1.1[/CENTER]
Can anyone tell me how can i solve this problem.