I wonder how I can redirect the user to the page I want as soon as he logs in? example
login: diego.santos password: 12345 wanted to redirect to example id1.php
login: santos.diego password: 12345 wanted to redirect to example id2.php
I wonder how I can redirect the user to the page I want as soon as he logs in? example
login: diego.santos password: 12345 wanted to redirect to example id1.php
login: santos.diego password: 12345 wanted to redirect to example id2.php
You should use the header
function, for example:
/** Redirecionar o usuário para /home.php: */
header('Location: /home.php');
Link to documentation .
You can only use this function before sending any response to the client, given that it is a response header.
To learn more, consider reading this question and answer .
It is best if you create Tags for each user and check the tags, but if you want a basic thing you can use this code:
if($nome == "diego.santos" && $password == "12345"){
header('Location: id1.php');
}else if($nome == "santos.diego" && $password == "12345"){
header('Location: id2.php');
}
This is a quick example and is not a correct way to login