here is the validate login page:
<?php
include ("config.php");
if(isset($_POST['submit'])){
$Nmutilizador = mysqli_real_escape_string($conn, $_POST['username']);
$pass = md5($_POST['Password']);
$lvlacesso = $_POST['NivelAcesso'];
$select = " SELECT *
FROM users
WHERE NmUtilizador = '$Nmutilizador'
&& PalavraPasse = '$pass' ";
$result = mysqli_query($conn, $select);
if(mysqli_num_rows($result) > 0){
$row = mysqli_fetch_array($result);
if ($_SESSION['NivelAcesso'] == '1') {
// check the value of the 'status' in the db
//go to admin area
header("Location: indexadmin.php");
} else {
//go to members area
header("Location: indexposlogin.php");
}
}else{
$error[] = 'incorrect email or password!';
}
};
?>
I wanted after validating the login to redirect to the page depending on the access level , I would appreciate you helping me as soon as possible, thank you
Im new at this of php