The following code return some results that are baffling me...
if(is_array($loginUser)) {
$_SESSION['name'] = $loginUser['firstname'];
$_SESSION['id'] = $loginUser['id'];
print_r($_SESSION['name']);
print_r($loginUser);
var_dump($loginUser[1]);
exit();
header("Location: ../index.php?page=home");
}
That returns:
Notice: Undefined index: firstname in wwwroot/includes/userhandler.php on line 124
Notice: Undefined index: id in wwwroot/includes/userhandler.php on line 125
Array ( [0] => Array ( [0] => 4 [id] => 4 [1] => Johnny [firstname] => Johnny [2] => Appleseed [lastname] => Appleseed [3] => ja@ja.com [email] => ja@ja.com [4] => johnny'shashedpassword [password] => johnny'shashedpassword ) )
Notice: Undefined offset: 1 in wwwroot/includes/userhandler.php on line 129
NULL