Merhaba Arkadaşlar,
Tdk dan veri çekmeye çalışıyorum ama denemelerim başarısız oldu. Acaba nerede hata yapıyorum?
<?php
$data = array(
'kelime' => 'deneme',
'gonder' => 'ARA',
'ayn' => 'tam',
);
$url = "http://tdk.gov.tr/index.php?option=com_bts&arama=kelime";
$useragent = 'Mozilla/5.0 (compatible; Googlebot/2.1; +[url]http://www.google.com/bot.html)';
$referer = 'http://www.google.com/';
$ch = curl_init();
$zaman = 0;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTS, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $zaman);
curl_setopt ($ch, CURLOPT_REFERER, $referer);
curl_setopt ($ch, CURLOPT_USERAGENT, $useragent);
$sonuc = curl_exec($ch);
curl_close($ch);
echo $sonuc;
?>