Hi, Matt Thanks for answer, I try your solution and use it. And interestingly I found this, If my request coming from second tab of firefox it will wait util first request done. I think php does not open second thread for same session... Anyway thanks for answer. It was very useful.. Regards On Monday 05 February 2007 20:32, Matt Carlson wrote: > function doRequest($method, $url, $vars = '', $headers = '0') { > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL, $url); > curl_setopt($ch, CURLOPT_HEADER, $headers); > curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); > curl_setopt($ch, CURLOPT_TIMEOUT, 30); > curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); > curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); > if ($method == 'POST') { > curl_setopt($ch, CURLOPT_POST, 1); > curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); > } > $data = curl_exec($ch); > curl_close($ch); > if ($data) { > return $data; > } > else { > return curl_error($ch); > } > } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php