[SOLVED] cURL Question
Posted: Mon Oct 04, 2004 1:06 pm
feyd | Please use
feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I have a curl script on page 1 that will post some values to page 2. Currently when page 1 performs the post using curl, page 1 stays waiting for a response from page 2. I don't want page 1 to sit idly by until page 2 returns something. I want page 1 to do the post with curl and continue executing any code left on that page. In other words, i want this post to be asynchronous. Below I have posted my script for the curl post. Any help will be greatly appreciated.Code: Select all
$posturl = "url i'm posting to";
$postvalues = "var1=val1&var2=val2";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$posturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,0);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvalues);
curl_exec($ch); // this is where it stays waiting until something returns from page 2.feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]