How to make an page only accessible when logged in, in PHP?
I want you when you click on the background to defend two buttons with Login And Register and you can only access these two buttons after you log in.
<?php
session_start();
include_once 'dbconnect.php';
?>
<!DOCTYPE html>
<HTML>
<head>
<title>NCS pagina principala</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport" >
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" >
</head>
<body>
<?php if (isset($_SESSION['usr_id'])) { ?>
<FONT size="4%" color="#66ffff" FACE="cursive">Esti conectat cu:</FONT><i><FONT size="5" color="#66ff66"> <?php echo $_SESSION['usr_name']; ?></FONT></i>
<link rel="stylesheet" href="styles/buttonstyle.css">
<a class="button" href="logout.php">Delogheaza-te</a>
<?php } else { ?>
<link rel="stylesheet" href="styles/buttonstyle.css">
<a class="button" href="login.php">Logheaza-te</a>
<a class="button" href="form.html">Cerere cont</a>
<?php } ?>
<head>
<a class="button" href="blacklist.php">BlackList</a>
<CENTER>
<BODY STYLE = "BACKGROUND: url(https://cdn.discordapp.com/attachments/389773843813629972/389781868247253002/thumb-1920-553248.jpg); BACKGROUND-SIZE:130%"></BODY>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
</HTML>