<?php
error_reporting(E_ALL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Google Botunun Son Ziyareti</title>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8" />
<link href="/sonindeks/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="iso">
<?php
$adres = $_POST["adres"];
//get googlebot last access
function googlebot_lastaccess($adres)
{
$request = 'http://webcache.googleusercontent.com/search?hl=en&q=cache:'.$adres.'&btnG=Google+Search&meta=';
$data = getPageData($request);
$spl = explode("appeared on", $data);
$spl2 = explode("GMT", $spl[1]);
$value = trim($spl2[0]);
return $value;
}
echo "Google Botunun Son Ziyareti </br></br> " . googlebot_lastaccess($adres) . "<br />";
function getPageData($url)
{
$ch = curl_init($url); // initialize curl with given url
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // add useragent
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // write the response to a variable
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30); // max. seconds to execute
$return = curl_exec($ch);
curl_close($ch);
return $return;
}
?>
</div>
</body>
</html>
bu sekilde bir deneyin
Herhangi bir hata kodu vermedi. Nedense birden çalışmaya başladı :
http://ismail.party/sonindeks/ . sanırım çalışmamasının nedeni googledan kaynaklanıyordu. User agent sorun olabilir diye tarayıcı olarak gösterdim useragenti. Şuan sorunsuz tekrar bozulmak inşallah.