Post values in PHP Headers
- by kumar
Hi.. I want send some data to a remote webpage from my site. Actually it can be achieved through form hidden variables. but for security reason, i want set as post variables in header and then send to that webpage. i use this code
$post_data = 'var1=123&var2=456';
$content_length = strlen($post_data);
header('POST http://localhost/testing/test.php HTTP/1.1');
header('Host: localhost');
header('Connection: close');
header('Content-type: application/x-www-form-urlencoded');
header('Content-length: ' . $content_length);
header($post_data);
but my code doesn't work properly.
help me...