CURLOPT_REFERER bilgisi de eklemeyi deneyin hocam
Şu şekilde düzenledim ref doğru mu verdim bilemiyorum ama bu sefer verdiği hata ve kodum;
$ch = curl_init("https://www.dr.com.tr");
$ref = curl_init("https://www.dr.com.tr/search?q=" . $isbn);
curl_setopt($ch,CURLOPT_REFERER,$ref);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Host: www.dr.com.tr',
'Referer: https://www.dr.com.tr',
'Cookie: DnR.customer=183e1f7d-32a5-4441-974c-9bebec39f671; NSC_es.dpn.us-wtfswfs-opjq=ffffffff09050b3245525d5f4f58455e445a4a423660',
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding: gzip, deflate',
'Accept-Language: tr-TR,en;q=0.5',
'Cache-Control: no-cache, must-revalidate',
'Connection: keep-alive',
'Content-Type: text/html; charset=utf-8',
'User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8',
));
$body = curl_exec($ch);
curl_close($ch);
echo $body;Hata:
HTTP/1.0 400 Bad Request Content-Type: text/html