need help with login php/html
Go to solution
Solved by Ominous,
I assume it's "opret_opslag.php" that you want to restrict access to? You need to check if a user is logged in.
Include this in the header:
<?php session_start(); // Check if the user is logged in if (!isset($_SESSION['brugernavn'])) { // Redirect to login page header("Location: login-side.php"); exit(); } ?>
Ideally, you should also perform the opposite of this action on login-side.php. Send logged-in users to opret_opslag.php instead of letting them view the login page.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now