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