include("ayar4.php");
mysql_connect($server,$user,$pass);
mysql_select_db($db);
$uid = $_GET['u'];
$sor = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM sorgu WHERE uid='".$uid."'"));
if($sor['COUNT(*)']==1) {
$url = mysql_fetch_array(mysql_query("SELECT url FROM sorgu WHERE uid='".$uid."'"));
$url = $url['url'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.bing.com/search?mkt=en-US&q=site%3a".urlencode($url)."");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.4) Gecko/20100513 Firefox/3.6.4");
$data = curl_exec($ch);
/* echo $data; */
curl_close($ch);
$pattern = '/<\/cite> · Cached page<\/a><\/div><\/div>/iU';
preg_match_all($pattern,$data,$cikti);
/* print_r($cikti); */
/* echo $cikti[1][0]; */
if(!empty($cikti[1][0])) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, str_replace('&','&',$cikti[1][0]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; rv:1.9.2.4) Gecko/20100513 Firefox/3.6.4");
$data = curl_exec($ch);
/* echo $data; */
curl_close($ch);
$pattern = "/it appeared on (.*)<\/strong>/iU";
preg_match($pattern, $data, $cikti);
if(!empty($cikti[1])) {
$date = new DateTime($cikti[1]);
$tarih = $date->format('d/m/Y');
$resim = imagecreatefrompng("msnbot.png");
$renk = imagecolorallocate($resim, 255, 255, 255);
imagestring($resim, 2, 35, 10, $tarih, $renk);
header("Content-type: image/png");
imagepng($resim);
imagedestroy($resim);
} else {
$resim = imagecreatefrompng("googlebot.png");
$renk = imagecolorallocate($resim, 255, 255, 255);
imagestring($resim, 2, 75, 10, "N/A", $renk);
header("Content-type: image/png");
imagepng($resim);
imagedestroy($resim);
} } else {
$resim = imagecreatefrompng("googlebot.png");
$renk = imagecolorallocate($resim, 255, 255, 255);
imagestring($resim, 2, 75, 10, "N/A", $renk);
header("Content-type: image/png");
imagepng($resim);
imagedestroy($resim);
}
}
?>
çalışmıyor yardım edebilicek biri varmı n/a yazıyor