POSTing data to an URL can be done with the curl extension, which allows one to send HTTP requests from PHP.
In your case, something like this might do the trick :
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
'event' => $event,
'when' => $when,
// ... more here
));
$returned = curl_exec($ch);
curl_close($ch);
For more informations you might want to take a look at the manual page of curl_exec
, and for more options (there are a lot of possible options !), see curl_setopt.
Here, the most important ones are :
CURLOPT_URL
: to specify the URL to which you want to post your data
CURLOPT_POST
: as you want to send an HTTP POST request -- and not GET, which is the default
CURLOPT_POSTFIELDS
: to specify the data that you want to send
But note this will not send several queries in parallel -- maybe curl_multi_exec
and the other curl_multi_*
functions could help, there...