Hi!
Trying to make a simple script with sessions. Have only worked with ASP before and this seems a little bit more tricky in PHP... Would be really glad if some one could help me... The problem is that $bLoginSuccess is empty when I get to thesite.php
I have a page (index.php) with a login-form that posts to login.php
--- login. php ----
<?php
session_start();
$bLoginSuccess = false;
if ($sUsername == "Rickard" && $sPassword == "12345")
{
$bLoginSuccess = true;
session_register("bLoginSuccess");
global $bLoginSuccess;
}
header ("Location: thesite.php")
?>
--- thesite.php ---
<?php
session_start();
global $bLoginSuccess;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<head>
<title>Untitled</title>
</head>
<body>
<?php
//echo "Utan session_start() - $bLoginSuccess<br>";
echo "Med session_start() - $bLoginSuccess";
?>
</body>