If you want to send data to the URL from the PHP code itself (without using the html form), this can be done using curl. It will look like this:
$url = 'http://www.someurl.com'; $myvars = 'myvar1=' . $myvar1 . '&myvar2=' . $myvar2; $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_POST, 1); curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt( $ch, CURLOPT_HEADER, 0); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec( $ch );
This will send post variables to the specified URL, and what the page returns will be in $ response.
Peter Anselmo Jun 20 '10 at 17:32 2010-06-20 17:32
source share