<?PHP session_start();
if(isset($_SESSION['bruger'], $_SESSION['brugernavn'], $_SESSION['error'])) {echo "<TD height='20' bgcolor='#FFFFFF'>Velkommen <B>".$_SESSION[brugernavn]."</B>";
echo"</TD>" ;} else {
echo "<TD><form action=\"".$_SERVER['PHP_SELF']."\" method=\"POST\">";
echo "<b><input type=\"hidden\" name=\"url\" value=" .$_SERVER['PHP_SELF']. ">
<input type=\"hidden\" name=\"var\" value=" .$_SERVER['QUERY_STRING']. "></b>";
echo "Brugernavn: <input type=\"text\" name=\"mail\"> Kodeord:<input type=\"password\" name=\"pass\"> <input type=\"submit\" name=\"login\" value=\"Login!\">";
echo "</form></TD>";}
?>
Det er min login
if($_POST['login']) {
if($_POST['mail'] && $_POST['pass']) {
$user_in_db = mysql_query("SELECT * FROM `nyheds_mail` WHERE email='".$_POST['mail']."' AND pass='".$_POST['pass']."'");
$user = mysql_fetch_assoc($user_in_db);
if($user['id']) {
$_SESSION['bruger'] = "ok";
$_SESSION['userid'] = $user['id'];
$_SESSION['mail'] = $user['email'];
$_SESSION['kodeord'] = $user['pass'];
$_SESSION['brugernavn'] = $user['navn'];
$_SESSION['status'] = $user['status'];
$loc = "
http://www.pokerskole.dk".$_POST['url']. "?" .$_POST['var'];
header("Location: $loc");
} else {
$_SESSION['error'] = "Du har enten skrevet et forkert brugernavn eller et forkert kodeord.";
header("Location: ?page=fjols");
}
} else {
header("Location: ?page=fejl");
}
}
Nu sender den mig tilbage, men hvorfor mangler mine sessions???