• 18-03-2016, 17:16:03
    #1
    Arkadaşlar merhaba,

    Php ile hazırlanmış bir websitesi var. Yalnız bu sayfalarda o sayfaya kaç kere girilmiş bir sayaç yok.

    Üst kısımdaki değişken url'ye bakarak sayaç yapılabilir mi?

    "Bu sayfa xx defa görüntülenmiştir." gibisinden.
  • 18-03-2016, 20:13:15
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Örneğe bakarak kendine yeni bir veritabanı oluştur kolay gelsin

    <?php
    $sef = $_GET["postseourl"];
    $id=$_GET['id'];
    $postsorgu = mysql_query("SELECT * FROM post WHERE postid=$id AND postseourl='$sef'");
    $postsonuc = mysql_fetch_object($postsorgu);
    
    if (!isset($postsonuc->postid))
    {
    	header("index.php");
    }
    else
    {
    $ip = $_SERVER['REMOTE_ADDR'];
    date_default_timezone_set('Europe/Istanbul');
    $tarih = date("Y-m-d");
    $saat = date("H:m:s");
    $hitsorgu = mysql_query("Select * from hit where ipadresi='$ip' and tarih='$tarih' and postid='$postsonuc->postid'");
    $hitsonuc = mysql_fetch_object($hitsorgu);
    if(!$hitsonuc)
    {
    	mysql_query("insert into hit(ipadresi,tarih,icerikid,saat) values ('$ip','$tarih','$postsonuc->postid','$saat')");
    	mysql_query("update post set izlenme=izlenme +1 where postid='{$postsonuc->postid}'");
    }
    
    }
    
    ?>


    --R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 20:13:15 -->-> Daha önceki mesaj 20:10:49 --

    İzlenmeyide şöyle çekebilirsin istediğin yere

    <?php echo $iceriksonuc->izlenme; ?>