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?