I am sending a link to a user, but since it is not logged in it directs you to the login page, but when it puts user and password it goes to the main page of the php system, how do I enter the username and password it opens the link and is not redirected to main page?
Below is the code that validates the login
<?php
$session_start();
$usuariot = $_POST['usuario'];
$senhat = $_POST['senha'];
include_once("conexao.php");
$result = $conn->query("SELECT * FROM proj_usuarios WHERE user_nome='$usuariot' AND user_senha='$senhat' LIMIT 1");
$resultado = mysqli_fetch_assoc($result);
if(empty($resultado)){
echo"<script language='javascript' type='text/javascript'>alert('Login e/ou senha incorretos');window.location.href='../login_giga.php';</script>";
die();
}else{
$_SESSION['usuarioID'] = $resultado['user_id'];
$_SESSION['usuarioNome'] = $resultado['user_nome'];
$_SESSION['usuarioSenha'] = $resultado['user_senha'];
$_SESSION['usuarioNivel'] = $resultado['user_nivel'];
$_SESSION['usuarionick'] = $resultado['nickname'];
if($_SESSION['usuarioNivel'] == 1){
header("Location:../paginas/layout/dashboard.php");
}}
?>
Thank you