I have below curl code to GET.
<?php
function get_content($URL){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_URL, $URL);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
echo get_content("http://www.domain.com/cool.php");
?>
I have used http headers and cookie looks like below
xidseq:22
xid:b05f251c-8a72-4c2b-a230-e03b9c5c87b7&&BAYIDSAMFE1C013&343
data:dsfsfssdss
I need to send GET request to http://www.domain.com/cool.php
with some cookies.
how do i put the cookie in cookie.txt ?? is there any specific format for cookies..or just posting it works ?