I'm a little confused with the following part of my script...
The variables $username and $password are coming from POST form and are ok.
session_start();
$errors = array();
if (empty($username) === true || empty($password) === true) {
$errors[] = 'You need to enter a username and password!';
$_SESSION['Errors'] = $errors;
} else if (user_exists($username) === false) {
$errors[] = 'We can\'t find the username! Have you registered?';
$_SESSION['Errors'] = $errors;
} else if (user_active($username) === false) {
$errors[] = 'You haven\'t activated your account!';
$_SESSION['Errors'] = $errors;
}
When I try to store any $errors[ ] variables in the session, the only value I find in the session variable is just "Array"...
But when I write the variable $errors (without [ ]) then it works...
How can I add in this case one or multiple dynamically stacked array variables to $_SESSION['Errors']?
It's probably simple, but I couldn't find any solution yet in the Internet.
Thank you very much in advance.