-1
<?
session_start();
$nome = filter_input(INPUT_POST, 'nome');
$_SESSION['nome'] = $nome;
?>
<form action="teste.php" method="post">
<input type="text" name="nome"> <br> <br>
<button>Enviar</button>
</form>
<?php
session_start();
if($_SESSION['nome'] == 'sim' ) {
echo 'Logado'; // Ele não entra aqui
} else {
header('location: index.php?login=erro'); // Ele so fica na pagina index, independente do valor passado no input
}
Now if I do so it logs, but it logs the user independent of the value passed in the input
session_start();
if($_SESSION['nome'] != 'sim' ) {
echo 'Logado'; //Ele entra aqui
} else {
header('location: index.php?login=erro');
}
Yes my logic would be this, but any value I type including the yes it enters the login.
– Diegosny