Here is my code:
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Cookie: ChosenSite=www"));
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Cookie: SportsDirect_AnonymousUserCurrency=GBP"));
curl_setopt($curl, CURLOPT_HTTPHEADER, array("Cookie: language=en-GB"));
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($curl, CURLOPT_VERBOSE, true);
$str = curl_exec($curl);
curl_close($curl);
I am trying to set these cookies as i am trying to parse HTML dom elements but it seems i am not able to set them correctly.
Can you please tell me where is my mistake, I am setting cookies correctly ?
Thanks in advance!