-1
I am making a login system is already working normally the problem is that I do not know how to change the navbar while the user is logged in:
Codigo Index:
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Redfield</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header>
<nav>
<img class="logo"src="AA.png" alt="">
<ul class="navlist">
<a href="index.php" style="text-decoration: none;">Home</a>
<a href="/" style="text-decoration: none;">Launcher </a>
<a href="/" style="text-decoration: none;">Social Media </a>
<a href="login.php" style="text-decoration: none;">Login</a>
</div>
</ul>
</nav>
</header>
<main>
</main>
</body>
</html>
Verification code:
session_start();
include("checking.php");
if(empty($_POST['usuario']) || empty($_POST['password'])){
header('Location: login.php');
exit();
}
$usuario = mysqli_real_escape_string($conexao ,$_POST['usuario']);
$senha = mysqli_real_escape_string($conexao ,$_POST['password']);
$query = "select usuario_id from usuario where usuario = '{$usuario}' and senha = md5('{$senha}')";
$result = mysqli_query($conexao, $query);
$row = mysqli_num_rows($result);
if($row == 1){
$_SESSION['usuario'] = $usuario;
header('Location: painel.php');
exit();
}else{
header('Location: login.php');
exit();
}