Problems with session
Posted: Thu Feb 27, 2003 7:44 am
THE IDEIA:
Hi everyone... Its is the problem.. I do a check in php, that build a session if the check is ok it build a session that build a variable 'validate' with value 1, and then redirect to another page called alvo.php.. In this php file it check it have this variable in session and if his value is 1.
If ok it , the page load normaly, if not redirect to another page...
THE PROBLEM:
THIS ALVO.PHP is not reading or not finding this variable in the session that i build in CHECK.PHP
THE CODE:
Check.php:
THE alvo.php
Hi everyone... Its is the problem.. I do a check in php, that build a session if the check is ok it build a session that build a variable 'validate' with value 1, and then redirect to another page called alvo.php.. In this php file it check it have this variable in session and if his value is 1.
If ok it , the page load normaly, if not redirect to another page...
THE PROBLEM:
THIS ALVO.PHP is not reading or not finding this variable in the session that i build in CHECK.PHP
THE CODE:
Check.php:
Code: Select all
<?php
$login = 'marcelo';
$senha = 'olandim';
if ($_POST['name']==$login & $_POST['password']==$senha){
session_start();
$_SESSION['validate'] = 1;
header("location: http://tange.com.br/alvo.php");
}
else {
header("location: http://tange.com.br/denovo.html");
exit
}
?>THE alvo.php
Code: Select all
<?php
if(!isset($_SESSION['validate']) && $_SESSION['validate']!=1){
header("Location: http://www.niagara.com.br/");
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
Oi pessoalm tudo bem, se vcs conseguem ver isto é que estão logados
</body>
</html>