Computer58
Aktif Üye
- Mesajlar
- 228
Arkadaşlar bu sayfaya admin panelinden birşey ekliyorum ekle butonuna basınca ekran siliniyor ve kaydetmiyor ???
Kod:
<?php
include ("inc/baglanti.php");
$sor = mysql_query("select * from ayarlar order by id desc");
$ayarlar = mysql_fetch_array($sor);
$id = $_GET['id'];
$sorhaber = mysql_query("select * from haberler where id = '$id'");
$haber = mysql_fetch_array($sorhaber);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $ayarlar[sitead];?></title>
<meta name="keywords" content="<? echo $ayarlar['anahtar'];?>" />
<meta name="description" content="<? echo $ayarlar['aciklama'];?>" />
<link href="css/stil.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
</head>
<body>
<div id="ana_hat">
<?php include("inc/ust.php");?>
<?php include("inc/menu.php");?>
<?php include("inc/flash.php");?>
<br />
<br />
<br />
<div id="ilet">
<h3>Haberler</h3>
<?
$gelen_sayfa = (isset($_GET['sayfa']) && $_GET['sayfa'] !='' ) ? intval($_GET['sayfa']) : 1;
//Bağlanılacak Tablo
$tablo = 'haberler';
//Sayafalamayı yapan dosyanın adı
$link = 'haberler.php';
//Sayfada kaç kayıt görünecek
$limit= 5;
//Kaç sayfa öncesi ve sonrası görünecek
$s_s = 10;
/*------------------------------------
Alan Başlıklarını ve $sonuc['alan1']
kısımlarını kendinize göre değiştirin
-------------------------------------*/
$s_sor = mysql_query("select count(id) from $tablo") or trigger_error(mysql_error(),E_USER_ERROR);
$satir = mysql_result($s_sor,0);
mysql_free_result($s_sor);
echo '<div id="habersira">';
if($satir >0){//sonuç varsa
$baslama = ($gelen_sayfa > 1) ? (($gelen_sayfa -1) * $limit) : 0 ;
$sayfa_kac = $satir/$limit;
$sayfa_sayisi = ($satir % $limit != 0) ? intval($sayfa_kac)+1 : intval($sayfa_kac);
$basla=( $satir >= $baslama ) ? $baslama : 0 ;
unset( $sayfa_kac, $baslama );
$sorgu = 'select * from '.$tablo.' order by id desc limit '.$basla.' , '.$limit;
$sorgula = mysql_query($sorgu) or trigger_error(mysql_error(),E_USER_ERROR);
$i=1;
while($sonuc=mysql_fetch_array($sorgula)){
?>
<div id="habdongu" onmouseover="this.style.backgroundImage='url(images/habersira_arka2.jpg)'" onmouseout="this.style.backgroundImage='url(images/habersira_arka.jpg)'">
<div style="float:left; width:100px;"><? if($sonuc[resim] == "") {?><img src="haberfoto/haberfotoyok.png" height="50px;"/><? }else{?><img height="50px" src="haberfoto/kucuk/<?php echo $sonuc['resim'];?>"/><? } ?></div>
<div onclick="window.location='haber_detay.php?id=<?php echo $sonuc[id];?>'" style="width:660px; padding:20px;"><a style="color:#000; text-decoration:none;" href="haber_detay.php?id=<?php echo $sonuc[id];?>"><?php echo $sonuc[baslik];?></a></div>
</div>
<?
$i++;
}//while son
mysql_free_result($sorgula);//hafızayı boşalt
$hangi_sayfa= ($gelen_sayfa > 0)? $gelen_sayfa : 1 ;
echo '
</div>
<div class="div_sayfa" align="center">
Toplam '.$sayfa_sayisi.' Sayfadan '.$hangi_sayfa.'. Sayfa<br /><br />';
$alt= ($gelen_sayfa - $s_s);
if($sayfa_sayisi <= $s_s || $gelen_sayfa <= $s_s ) {$alt=1;}
$ust= (($gelen_sayfa + $s_s)< $sayfa_sayisi ) ? ($gelen_sayfa + $s_s) : ($sayfa_sayisi);
echo ($gelen_sayfa > 1 )? '<a href="'.$link.'?sayfa=1" title="Ä°lk Sayfa"><strong>« </strong></a><a href="'.$link.'?sayfa='.($gelen_sayfa -1).'" title="Önceki Sayfa"><strong>Geri</strong></a>':' ';
for($i=$alt; $i<=$ust ;$i++){
echo ($i != $gelen_sayfa ) ? '<a title="'.$i.'. Sayfa" href="'.$link.'?sayfa='.$i.'">'.$i.'</a>' : '<span class="self">'.$i.'</span>';
}
echo ($gelen_sayfa < $sayfa_sayisi)? '<a href="'.$link.'?sayfa='.($gelen_sayfa +1).'" title="Sonraki Sayfa"><strong>Ä°leri</strong></a><a href="'.$link.'?sayfa='.$sayfa_sayisi.'" title="Son Sayfa"><strong> »</strong></a>' :'';
echo '</div>';
}
else{
echo '<tr><td colspan="5">Haber Bulunmamaktadır !</td></tr></table>';
}
?>
</div>
<?php include("inc/alt.php");?>
</div>
</body>
</html>