(SOLVED) header Location, parameters
Posted: Wed Jan 16, 2013 5:25 pm
I have this very basic piece of code, for the welcome, I see the url parameter, but
not for the login failed, which redirects the user back to /login/. Why?
not for the login failed, which redirects the user back to /login/. Why?
Code: Select all
if (mysqli_num_rows($result_set) == 1) {
$found_user = mysqli_fetch_array($result_set);
$_SESSION['user_logged'] = TRUE;
$_SESSION['name'] = $found_user['name'];
$_SESSION['success_msg'] = 'Olá, ' . $found_user['name'] . '!';
/* The parameter is always there. */
header('Location: ../welcome/?login=true');
}
else {
$_SESSION['error_msg'] = 'Dados inválidos.';
/* No parameters in the url here. Why? */
header('Location: ../login/?login=false');
}