Maybe it isn't the best way but for me it works ;-)
Writing cookies:
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://bbapi.buzzerbeater.com/login.aspx?login=XXX&code=YYY');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_COOKIEJAR, '[PATH]/cookies.txt');
$source = curl_exec($curl);
curl_close($curl);
echo $source;
// XXX - login
// YYY - access code
// [PATH] - path to file cookies.txt
Using cookies:
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_URL, "http://bbapi.buzzerbeater.com/countries.aspx");
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl2, CURLOPT_COOKIEFILE, '[PATH]/cookies.txt');
$source2 = curl_exec($curl2);
curl_close($curl2);
echo $source2;
// http://bbapi.buzzerbeater.com/countries.aspx - example of BBAPI page
Last edited by B.B.King at 10/26/2011 10:54:50 AM