Php redirecting [duplicate]

-1
header('Location: leticia.php?id=1' .$usuario);
header('Location: barbara.php?id=2' .$usuario);

I'm trying to redirect 2 logged in users, each to your page using the above code, but when you log in, redirect the 2 to the same page that is the leticia.php , how to fix?

    
asked by anonymous 25.05.2018 / 23:05

2 answers

0

Do the following:

if ($usuario == 1) {
    header('Location: leticia.php?id=1' .$usuario);
} else {
    header('Location: barbara.php?id=2' .$usuario);
}
    
25.05.2018 / 23:39
0

$ result_user = mysqli_query ($ conn, $ result_user); if ($ result_user) {     $ row_user = mysqli_fetch_assoc ($ result_user);     if (password_verify ($ password, $ row_user ['password'])) {         $ _SESSION ['id'] = $ row_user ['id'];         $ _SESSION ['name'] = $ row_user ['name'];         $ _SESSION ['email'] = $ row_user ['email'];

    **header('Location: leticia.php?id=1' .$usuario);
    header('Location: barbara.php?id=2' .$usuario);**

}else{
    $_SESSION['msg'] = "Login e senha incorreto!";
    header("Location: login.php");
} esse é meu codigo.
    
28.05.2018 / 15:23