Answer the question
In order to leave comments, you need to log in
How to prevent an authorized user from accessing the page with authorization and registration7?
Here I have a website, it has a system with registration and authorization, after authorization it redirects to the main page with the data that the user entered, but if you enter the url in the address bar with the page with authorization / registration, then you can safely go.
So here is the essence of the question: how to prevent the user from accessing these pages if he has already logged in?
$_SESSION['regist'] = $btn_reg;
if(isset($_SESSION['regist'])){
header("Location: /");
}
?>
Answer the question
In order to leave comments, you need to log in
check on those pages not a button, but whether the user is authorized, if authorized, then redirect where you need, or show something else, instead of authorization / registration forms
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question