Thread: php sessions
View Single Post
  #1 (permalink)  
Old 06-09-03, 06:10 PM
burningr burningr is offline
Newbie Coder
 
Join Date: Jun 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Question php sessions

can anybody help me with this problem?
I have this script, it should activate a session if i'm typing in "brukernavn" & "passord" correctly

Quote:
<?php

if($_POST["b"] == "Haavard" && $_POST["p"] == "bo") {

session_start();
session_register('innlogget');

?>

<html>
<head>
<title>Du er logget inn</title>
<link rel="stylesheet" href="../css/basic.css">
</head>
<body>
<hr>
<h1>Du er nå logget inn, <?php echo $_POST["b"]; ?></h1>
<hr>
<h2><a href="medlemsider.php" title="Medlemsider">Trykk Her</a></h2>
</body>
</html>

<?php
}
elseif($_POST["b"] == "Mathias" && $_POST["p"] == "bo") {

session_start();
session_register('innlogget');

?>

<html>
<head>
<title>Du er logget inn</title>
<link rel="stylesheet" href="../css/basic.css">
</head>
<body>
<hr>
<h1>Du er nå logget inn, <?php echo $_POST["b"]; ?></h1>
<hr>
<h2><a href="medlemsider.php" title="Medlemsider">Trykk Her</a></h2>
</body>
</html>

<?php

}




else {

echo "du er ikke logget inn";

}




?>
but i'm not shure it is because when i take it to this script :
Quote:
<?PHP
session_start();
if (!isset($_SESSION['innlogget']) || $_SESSION['innlogget']!= true)
{
header('Location: index.php');
}
?>
it sends me right back to index.php when it's supose to let me trough if i have the right session, can anyone help me pls?
__________________
Thanks for helping Me
Reply With Quote