Burası sayfanın en başındaki kodlar:
<?php
//Burası hesaplamayı yapan fonksiyonumuz
function acilma_suresi (){
$time = explode( ". ", microtime());
@$usec = (double)$time[0];
@$sec = (double)$time[1];
return $sec + $usec;
}
?>
<?
include("mysql_baglanti.php");
?>
<?
$ip=$HTTP_SERVER_VARS['REMOTE_ADDR'];
$gun=date("d");
$ay=date("m");
$yil=date("Y");
if ($gun<10)
$gun="0".$gun;
$tarih=$gun.'-'.$ay.'-'.date("Y");
$tarih_son=$tarih.' '.date("H:i:s");
$time=date("H:i:s");
$query21="SELECT max(id),sayac FROM ipler where ip='".trim($ip)."' and ay=".$ay." and yil=".$yil." and gun=".$gun." and girilen_sayfa=1 group by id";
$result31 = mysql_query ( $query21,$connect);
@$row_ziyaret_up = mysql_fetch_row($result31);
if (@$row_ziyaret_up[0]!=NULL)
{
$sayac=1+$row_ziyaret_up[1];
$sql_sorgu="update ipler set sayac='$sayac' where id=".$row_ziyaret_up[0];
$result=mysql_query($sql_sorgu);
@$row = mysql_fetch_row($result);
}
$query2="SELECT max(id) FROM ipler where ay=".$ay." and yil=".$yil." and gun=".$gun." and ip='".trim($ip)."' and girilen_sayfa=1 group by id";
$result3 = mysql_query ( $query2,$connect);
@$row_ziyaret = mysql_fetch_row($result3);
if(@$row_ziyaret[0]==NULL)
{
@$sql_sorgu="insert into ipler (id,girilen_sayfa,ip,tarih,gun,ay,yil,saat,tarih_son,sayac)
values(null,'1','$ip','$tarih','$gun','$ay','$yil','$time','$tarih_son','1')";
@$result=mysql_query($sql_sorgu);
if (!@$result)
{
echo "hata var.";
exit();
}
}
?>
<?
$ip=$HTTP_SERVER_VARS['REMOTE_ADDR'];
$gun=date("d");
$ay=date("m");
$yil=date("Y");
if ($gun<10)
$gun="0".$gun;
$tarih=$gun.'-'.$ay.'-'.date("Y");
$tarih_son=$tarih.' '.date("H:i:s");
$time=date("H:i:s");
$query2="SELECT max(id) FROM ziyaret where ay=".$ay." and yil=".$yil." and gun=".$gun." and girilen_sayfa=3 group by id";
$result3 = mysql_query ( $query2,$connect);
@$row_ziyaret = mysql_fetch_row($result3);
if(@$row_ziyaret[0]==NULL)
{
@$sql_sorgu="insert into ziyaret (id,girilen_sayfa,ip,tarih,gun,ay,yil,saat,tarih_son,sayac)
values(null,'3','$ip','$tarih','$gun','$ay','$yil','$time','$tarih_son','1')";
@$result=mysql_query($sql_sorgu);
@$row = mysql_fetch_row($result);
}
$query21="SELECT max(id),sayac FROM ziyaret where ay=".$ay." and yil=".$yil." and gun=".$gun." and girilen_sayfa=3 group by id";
$result31 = mysql_query ( $query21,$connect);
@$row_ziyaret_up = mysql_fetch_row($result31);
if (@$row_ziyaret_up[0]!=NULL)
{
$sayac=1+$row_ziyaret_up[1];
$sql_sorgu="update ziyaret set sayac='$sayac' where id=".$row_ziyaret_up[0];
$result=mysql_query($sql_sorgu);
@$row = mysql_fetch_row($result);
}
?>Burası da ilgili alandaki kodlar:
<?
$sql_sorgu1="select manset,haber_id,spot,baslik,icerik,resim,renk,baska_sayfa,gun,ay,yil,saat,dakika,haber_kaynak from haber
where haber_id=".$id;
$result1=mysql_query($sql_sorgu1);
@$row_manset = mysql_fetch_row($result1);
$sql_sorgu2="select id,dosyaadi,resim from resim
where id=".$row_manset[5];
$result2=mysql_query($sql_sorgu2);
@$row_resim = mysql_fetch_object($result2);
$kesik ="";
$kesik = $row_manset[2];
$kesik = str_replace("\'", "'", $kesik);
$kesik = str_replace("\\\"", "\"", $kesik);
?>
<table width=91% height="75">
<tbody>
<TR>
<? $a1=strlen($row_manset[5]);
?>
<?
if ($a1>=5)
{ ?>
<TD style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><img SRC='pictures/<?=$manset[5] ?>.jpg' width="296" height="157" align="top"></td>
<? }
else
{ ?>
<TD style="BORDER-RIGHT: #000000 1px solid; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid; BORDER-BOTTOM: #000000 1px solid"><img SRC='resimgetir.php?id=<?=$row_manset[5]?>' width="296" height="157" align="top"></td>
<? } ?>
Teşekkürler.