Possible Duplicate:
PHP: Notice: Undefined index where the session variable is defined
PHP: “Notice: Undefined variable” and “Notice: Undefined index”
Ok, so this is the Error:
Notice: Undefined index: overview_id in C:\xampp\htdocs\site\home.php on line 6
And this is my code:
<?php session_start();
$sess = $_SESSION["overview_id"];
if(isset($sess)){
header("Location: account.php");
}
?>
Any help would be cool.
Thank you.
overview_idelement is defined (and you DO check it, withisset), why do you create a temporary variable, assign this value to it and only then check this variable? Why don't justif(isset($_SESSION['overview_id']))then? I mean, what's the reasoning behind this logic?