Post values in PHP Headers
        Posted  
        
            by kumar
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by kumar
        
        
        
        Published on 2010-06-09T05:59:49Z
        Indexed on 
            2010/06/09
            6:02 UTC
        
        
        Read the original article
        Hit count: 218
        
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...
© Stack Overflow or respective owner