/ Published in: PHP
                    
                                        
From http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
function do_post_request($url, $data, $optional_headers = null)
{
'method' => 'POST',
'content' => $data
));
if ($optional_headers !== null) {
$params['http']['header'] = $optional_headers;
}
if (!$fp) {
throw new Exception("Problem with $url, $php_errormsg");
}
if ($response === false) {
throw new Exception("Problem reading data from $url, $php_errormsg");
}
return $response;
}
URL: http://netevil.org/blog/2006/nov/http-post-from-php-without-curl
Comments
 Subscribe to comments
                    Subscribe to comments
                
                