Hi I'm trying to post using http headers here is what I got: $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); PHP: When this code runs, I get a save as "file.php" dialog for some reason. I need to post this data and be redirected to $host/$path (just like when a user submits a form). Is this possible? How? Thanks
http://curl.haxx.se/mail/curlphp-2006-07/0003.html <?php $post = Array(); $post[1] = urlencode('test1'); $post[2] = urlencode('test2'); $post[3] = urlencode('test3'); $curl = curl_init("post.php"); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); $response = curl_exec($curl); curl_close($curl); header('Location: '); ?> PHP: