The ideia:
One html form send two variables that the user have writed. 'name' and 'pass', to a file called check.php.
In this check php, it build another two variables, one called 'name2' and another 'pass2'... after that, the script compare the values of the variables that the user send to the values builded in the check.php.
If they are equals, the script redirect the user to another page called 'teste.php' and build a session with variable 'validate' = 1...
In the teste.php, it first of all, see if the _session['validate'] have the value 1, if not, it direct the user to an error page...
I do that, because if the user try get arrive in the page teste.php with out going to check, he can't see the page.
But this is don't working.. Why...
I will pass the code.
check.php
Code: Select all
<?php
$name2 = 'marcelo'
$pass2 = 'olandim'
if ($_POST['name'] == $name2 & $_POST['pass'] == $pass2){
session_start();
$_SESSION['validate'] = 1;
header ("location: http://tange.com.br/teste.php");
exit
}
else{
header ("location: http://tange.com.br/denovo.html");
exit
?>Code: Select all
<?php
if($_session['validate != 1'){
header("Location: http://www.niagara.com.br/");
}
?>