H
H
historyfootball02018-07-25 14:33:43
User identification
historyfootball0, 2018-07-25 14:33:43

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: /");
}
?>

Above is the code that checks if the user clicked on the registration button or not, however, it works, but if you click on "Go back" (Arrow at the top)) it will go to the registration page, but I need to disable it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav B, 2018-07-25
@S_Borchev

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 question

Ask a Question

731 491 924 answers to any question