Merhaba ArkadaşLar Benim Halledemediğim Bir Konu Var Web Sitemde Online Sayaç Var Ve bu Sayaç Gece 00:00 Sıfırlama Yapacak Yerine Sabah 08:00 De yapıyor Ve Çözemedim Sorunu Yardımcı oLursanız Sevinirim
Web Site: https://www.eniyisozler.net/ Sayaç Sağ Sidebar'da
Sayaç Kodu:
echo "
    <table border='1' width='240' height='170' id='table1' bordercolor='#3399FF' bgcolor='#FFFFFF' >
        <tr>
            <td width='16' align='center' height='20'>
            <img border='0' src='img/on.gif' width='16' height='16'></td>
            <td width='75' height='20'>
            <font face='Tahoma' color='#FF0000'><span style='font-size: 9pt'>Online Ziyaretçi</span></font></td>
            <td width='67' height='20'>
            <font face='Tahoma' style='font-size: 10pt' color='#FF0000'>" ; 
#---Aktif Ziyaretçi Sayısı--------------------------------------------------------------------
$ip = $_SERVER['REMOTE_ADDR']; 
$past = time()-150; 
mysql_query("DELETE FROM online WHERE time < $past"); 
$result = mysql_query("SELECT time FROM online WHERE ip='$ip'"); 
$time = time(); 
if($row = mysql_fetch_array($result)){ 
mysql_query("UPDATE online SET time='$time',ip='$ip' WHERE ip='$ip'");
}else{ 
mysql_query("INSERT INTO online (ip,time) VALUES ('$ip','$time')") or die(mysql_error()); 
} 
$result   = mysql_query("SELECT ip FROM online"); 
$aktifkac = mysql_num_rows($result);
echo $aktifkac;     
#---Aktif Ziyaretçi Sayısı--------------------------------------------------------------------            
            echo "</font></td>
        </tr>
        <tr>
            <td width='16' align='center' height='20'>
            <img border='0' src='img/user.gif' width='16' height='16'></td>
            <td width='75' height='20'>
            <font face='Tahoma' style='font-size: 8pt'>Bugün Tekil</font></td>
            <td width='67' height='20'>
            <font face='Tahoma' style='font-size: 9pt' color='#003366'>"; 
#---Bugün Tekil Toplam Kaç Kişi Girmiş--------------------------------------------------------            
$bugun = date("Y-m-d");
$sorgu = mysql_query("select tarih from ziyaret where tarih='$bugun'");
$bugunku = mysql_num_rows($sorgu);
echo $bugunku;             
#---Bugün Tekil Toplam Kaç Kişi Girmiş--------------------------------------------------------        
            echo "</font></td>
        </tr>
        <tr>
            <td width='16' align='center' height='20'>
            <img border='0' src='img/user.gif' width='16' height='16'></td>
            <td width='75' height='20'>
            <font face='Tahoma' style='font-size: 8pt'>Dün Tekil</font></td>
            <td width='67' height='20'>
            <font face='Tahoma' style='font-size: 9pt' color='#003366'>"; 
#---Dün Tekil Toplam Kaç Kişi Girmiş----------------------------------------------------------
$baslat  =date(Y."-".m."-".d);
$year    =substr($baslat, 0,4);
$month   =substr($baslat, 5, 2);
$day     =substr($baslat, 8, 2);
$bitis   =date("Y-m-d", mktime(0, 0, 0, $month, $day-1, $year));
$sorgula = mysql_query("select tarih from ziyaret where tarih='$bitis'");    
$dunku = mysql_num_rows($sorgula);
echo $dunku;
#---Dün Tekil Toplam Kaç Kişi Girmiş----------------------------------------------------------        
            echo "</font></td>
        </tr>
        <tr>
            <td width='16' align='center' height='20'>
            <img border='0' src='img/users.gif' width='16' height='16'></td>
            <td width='75' height='20'>
            <font face='Tahoma' style='font-size: 8pt'>Toplam Tekil</font></td>
            <td width='67' height='20'>
            <font face='Tahoma' style='font-size: 9pt' color='#003366'>"; 
#---Toplam Tekil Kaç Kişi Girmiş--------------------------------------------------------------            
$ipsi  = $_SERVER['REMOTE_ADDR'];
$tarih = date("Y-m-d");
$ipkontrol = mysql_query("select * from ziyaret where ip='$ipsi' order by id desc");
$yaz   = mysql_fetch_assoc($ipkontrol);
$vip   = $yaz['ip'];
$vtarih= $yaz['tarih'];
$bak = mysql_num_rows($ipkontrol);
if($bak>0){  //if-
    if($vtarih<$tarih){
    $kayit_1 = mysql_query("insert into ziyaret (ip,tarih) values ('$ipsi','$tarih')");
    } 
}//if-
else{
$kayit_2 = mysql_query("insert into ziyaret (ip,tarih) values ('$ipsi','$tarih')");
}
$toplamne = mysql_query("select * from ziyaret");
$toplamziyaret  = mysql_num_rows($toplamne);
echo $toplamziyaret;            
#---Toplam Tekil Kaç Kişi Girmiş--------------------------------------------------------------            
            echo "</font></td>
        </tr>                        
        <tr>
            <td width='16' align='center' height='20'>
            <img border='0' src='img/ip.gif' width='16' height='16'></td>
            <td width='142' colspan='2' height='20'>
            <font face='Tahoma' style='font-size: 8pt'>IP Adresiniz: </font>
            <font face='Tahoma' style='font-size: 9pt'> [ </font>
            <font face='Tahoma' style='font-size: 9pt' color='#FF0000'> $ipsi </font>
            <font face='Tahoma' style='font-size: 9pt'> ] </font></td>
        </tr>                        
    </table>
</div>";