/* LOGIN.PHP */
<?php
$_SESSION['kadi'] = 'admin@admin.com';
$_SESSION['sifre'] = '123456'
?>
şeklinde sessionlarını oluştur. daha sonra index.php de bunları kontrol et.
/* LOGIN.PHP */
/* INDEX.PHP */
<?php
if($_SESSION['kadi'] == '' || $_SESSION['kadi'] == null ||$_SESSION['sifre'] == '' || $_SESSION['sifre'] == null)
{
header("refresh:login.php");
}
else
{
echo 'Giriş Başarılı';
}
?>
/* INDEX.PHP */
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 10:13:52 -->-> Daha önceki mesaj 10:11:59 --
Php ile Kontrol Paneli yapıyorum şu login olayında bir sorum olacak şimdi kullanıcı giriş felan herşey tamam çalışıyor fakat siteismi/index.php girince login sayfası gelmeden direkt olarak giriş yapıyor kullanıcı panel sayfalarını yazsa bile önce giris.php yönlenmesini istiyorum biraz araştırdım;
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
$isValid = False;
if (!empty($UserName)) {
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "giris.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0)
$MM_referrer .= "?" . $_SERVER['QUERY_STRING'];
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>Yukarıdaki kodu buldum index.php ye yapıştırdım oldu index.php yazsam bile giris.php yönleniyor fakat bu seferde k.adı sifre girince index.php gidiyor index.phpde login olsak bile tekrardan giris.php yönlendiriyor. Bunu nasıl çözebiliriz
örnek kod paylaştım