|
Posted by Benjamin on 12/17/06 03:04
seaside wrote:
> I need to POST a HTTP request from within a PHP app, to inform another
> app regarding certain changes.
>
> Since I don't need to get an answer back, I'd like to fire-and-forget
> the POST request asynchronously.
>
> An option might be to create a new PHP process, forward my data to the
> new instance and continue execution in the main one.
no, you don't need to do this
>
> Are there other options? Options, which don't require to interact with
> the OS directly?
you can use the cURL PHP extension to do this really easily
here's an example:
$curl = curl_init("http://www.mypostapp.com/blah/foo");
curl_setopt(CUROPT_POST, true);
curl_setopt(CUROPT_POSTFIELDS, $mypost);
curl_exec($curl);
curl_close($curl);
Navigation:
[Reply to this message]
|