<?PHP
include('config.php');
# Validar os dados do usuário
function anti_sql_injection($string)
{
include('config.php');
$string = stripslashes($string);
$string = strip_tags($string);
$string = mysqli_real_escape_string($conexao,$string);
return $string;
}
$sql = mysqli_query($conexao,"select * from sec_iden where login_sec='".anti_sql_injection($_POST['login_sec'])."' and senha_sec='".anti_sql_injection($_POST['senha_sec'])."' limit 1") or die("Erro");
$linhas = mysqli_num_rows($sql);
if($linhas == '')
{
?>
<div class="msg2 padding20">Usuário não encontrado ou usuário e senha inválidos.</div>
<?PHP
}
else
{
while($dados=mysqli_fetch_assoc($sql))
{
session_start();
$_SESSION['login_sec_sessao'] = $dados['login_sec'];
header("Location: conteudo.php");
}
}
?>
Well I wanted it when the field I created in called db (adm was = 1) it redirected to administrative.php and when it was = 0 for conteudo.php but I'm not able to do this, an if would solve this and where would I put this if?