Aşağıdakileri test eder misin..
giris.php
<?php
include("conf/baglanti.php");
session_start();
$Kullanici_Adi = $_POST["Kullanici_Adi"];
$Sifre = $_POST["Sifre"];
$sorgu = mysql_query("select * from Kullanicilar where Kullanici_Adi = '$Kullanici_Adi' and Sifre='$Sifre'");
if(mysql_num_rows($sorgu) > 0) {
$bilgi = mysql_fetch_assoc($sorgu);
$_SESSION["Giris"] = 'ok';
$_SESSION['Kullanici_Adi'] = $bilgi['Kullanici_Adi'];
header('Location:./');
}else{
header('Location:hata.php');exit;
}
?>kontrol.php
<?php
if( $_SESSION["Giris"] != 'ok' || $_SESSION["Kullanici_Adi"] == '' ){
echo 'Giriş yapmadınız.';
exit;
}
?>cikis.php
<?php
session_start();
session_destroy();
header('Location:login.php');
exit;
?>