lille login script med session virker ikke
Hey!Jeg har lige lavet sådan et lille script til at hjælpe mig med at lære sessions, men det virker ikke. Den tager ikke imod passwaordet:
<?php
session_start()
?>
<html>
<head>
<title>MminiCMS</title>
<style type="text/css">
body {
background-color:#82B31A;
font-family:tahoma;
font-size:10px;
color:black;
}
</style>
</head>
<body>
<php if(empty($_POST['login']){
?>
<form method="post" action="<?php $php_self; ?>">
<input type="pass" name="pw">
<input type="submit" name="login" value="login">
</form>
<?php
} else {
}
if(isset($_POST['login']) && $_POST['pw'] == 'hey'){
$_SESSION['pm'] = 'yes';
print "Good pass"
} else {
$_SESSION['pm'] = 'no';
print "bad pass";
}
?>
</body>
</html>
Kan i se fejlen.. På forhånd tak!