$_SESSION dizisine bir noktada müdahale ediliyordur büyük ihtimal. Bir sorum ve birkaç isteğim olacak.
Herhangi bir class kullanıyor musunuz?
session_start(); dan sonra $SESS = $_SESSION; kodunu ekleyip istediğiniz herhangi bir yere echo $SESS['admin']; kodunu eklediğinizde çıktı alıyor musunuz? Bunu kontrol etmenizi istiyorum.
Ayrıca error_reporting(E_ALL); kodunu en üste ekleyerek herhangi bir problem varsa bir ihtimal ortaya çıkabilir.
malesef olmuyor
login.php kodlarımı yazıyorum
<?PHP session_start(); ?>
<?PHP require_once("ayar.php"); ?>
<?PHP include("inject.php"); ?>
<?PHP
error_reporting(E_ALL);
$SESS = $_SESSION;
$admin = $SESS['admin'];
echo $SESS['oturum'];
if (isset($admin)) {
echo "<meta http-equiv='Refresh' content='0; URL=panel.php'>";
} else {
?>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Promo Ajans - Yönetim Paneli</title>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/bootstrap.css"/>
<style>
body{
overflow: hidden;
}
</style>
<script type="text/javascript" src = "js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src = "js/script.js"></script>
<script>
$(function() {
/* Hide form input values on focus*/
$('input:text').each(function() {
var txtval = $(this).val();
$(this).focus(function() {
if ($(this).val() == txtval) {
$(this).val('')
}
});
$(this).blur(function() {
if ($(this).val() == "") {
$(this).val(txtval);
}
});
});
});
</script>
</head>
<body>
<div class="icerik">
<?PHP
$islem = $_GET['islem'];
switch ($islem) {
case "dogrula":
$username = replaceSymbols($_POST['username']);
$password = replaceSymbols($_POST['password']);
$sql = mysql_query("SELECT * FROM admin WHERE kullanici='$username' AND sifre='$password'");
if (mysql_num_rows($sql) > 0) {
$SESS['oturum'] = $username;
echo "<div class='login-alert' style='color:#609100!important;'><img style='padding-right:7px; margin-top:5px; float:left;' src='images/giris.png' alt=''/><b4>Başarıyla Giriş Yapıldı...</b4></div>";
echo "<meta http-equiv='Refresh' content='0; URL=panel.php'>";
} else {
echo "<div class='login-alert' style='color:#a20000!important;'><img style='padding-right:7px; margin-top:5px; float:left;' src='images/hata.png' alt=''/><b4>Kullanıcı adınız veya Şifreniz yanlıştır.</b4></div>";
}
?>
<div class="login-bg">
<div class="logo">
<img src="images/logo.png"/>
</div>
<div class="form">
<div class="">
<yazi>Kullanıcı Adınız :</yazi><br>
<form action="login.php?islem=dogrula" method="post">
<input name="username" class="input-text" value="Kullanıcı Adı" type="text" /><br>
<yazi>Şifreniz :</yazi><br>
<input name="password" class="input-text" value="" type="password" /><br>
</div>
<a href="../index.php"><yazi>Siteye Dön</yazi></a>
<input type="image" img src="images/giris-bt.png" hover="images/giris-hv.png" class="rollover login-bt" value="">
</form>
</div>
</div>
<div class="login-golge">
<img src="images/login-golge.png"/>
</div>
</div>
</body>
</html>
<?PHP
break;
default:
?>
<div class="login-bg">
<div class="logo">
<img src="images/logo.png"/>
</div>
<div class="form">
<div class="">
<yazi>Kullanıcı Adınız :</yazi><br>
<form action="login.php?islem=dogrula" method="post">
<input name="username" class="input-text" value="Kullanıcı Adı" type="text" /><br>
<yazi>Şifreniz :</yazi><br>
<input name="password" class="input-text" value="" type="password" /><br>
</div>
<a href="../index.php"><yazi>Siteye Dön</yazi></a>
<input type="image" img src="images/giris-bt.png" hover="images/giris-hv.png" class="rollover login-bt" value="">
</form>
</div>
</div>
<div class="login-golge">
<img src="images/login-golge.png"/>
</div>
</div>
</body>
</html>
<?PHP
break;
}
}
?>
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 11:52:11 -->-> Daha önceki mesaj 10:30:13 --
<?PHP session_start(); ?>
<?PHP
$islem = $_GET['islem'];
switch($islem){
case "u":
$deger = $_POST['deger'];
$_SESSION['oturum'] = $deger;
break;
}
?>
<form action="?islem=u" method="post">
<input type="text" name="deger">
<br>
<input type="submit" value="gonder">
</form>
<?PHP
$oturum = $_SESSION['oturum'];
if(isset($oturum)) {
echo $oturum;
}
?>
bu kodları farklı klasörde index.php olarak attığımda session sorunsuz oturum açıyor. Acaba sorun nereden kaynaklı ?