Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End access the admin panel page only if logged in Reply To: access the admin panel page only if logged in

#157220
zuad
Participant

While checking the user credentials while log in set a session variable if the user credentials are valid.. Then on the admin panel page check if the session variable is set or not ? If it is set then show the admin page or else redirect the user to the login page.

    <?php


if(isset($_SESSION['user'])){ header('Location : adminpanel.php'); else header('Location : login.php'); }

?>

Put this code in the admin panel page start.