A
Anonymous
Guest
Please excuse the example below its an excersize I'm just learning. I'm having issues with the session variables. the below code runs ok however when I try and use the variable on another page it errors out with "Notice: Undefined variable: _SESSION in bla/bal/bla.php on line 31"
below is what I'm using to recall the values from this session variable
Code:
<?php
session_start( );
while($row = mysql_fetch_array($result)){
if ($_POST["passwordF"] == "$row[passfield]" && $_POST["usernameF"] == "$row[userfield]") {
$_SESSION['sessionuser'] = "$row[userfield]";
header("Location: bla/bal/granted.php");
} else {
header("Location: bla/bal/denied.php");
}
}
?>
below is what I'm using to recall the values from this session variable
Code:
<?php echo $_SESSION['sessionuser']; ?>