0
<?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 that when the field I created in db called ( Adm was = 1 ) it would redirect to administrative.php and when it was = 0 for content.php but I’m not able to do that, an if would solve that and where I would put that if ?
Some of the links: https://answall.com/questions/50839/70 , https://answall.com/questions/3864/70 and https://answall.com/questions/256111/70
– Bacco
I’ve commented on 3 or 4 posts here on this "anti Injection". You get the hint, start the code function, because there are forums that share functions of this type, but only serve to be embarrassed. Search right here on the site how to avoid SQL injection that has the right solutions.
– Bacco
@Bacco I’ve pulled out bro, vlw .
– Ming