Primo commit: trasferimento del progetto PPEasy
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
session_start();
|
||||
$password="xxxxxx"; /* inserire su questa riga la password voluta */
|
||||
if (isset($_SESSION['login'])) {
|
||||
if (isset($_POST['logout'])) {
|
||||
unset($_SESSION['login']);
|
||||
$messaggio = "Logout effettuato con successo! Arrivederci!";
|
||||
} else {
|
||||
header("Location: protetta.php");
|
||||
}
|
||||
} else {
|
||||
if (isset($_POST['password'])) {
|
||||
if ($_POST['password'] == $password) {
|
||||
$_SESSION['login'] = "verificata";
|
||||
header("Location: protetta.php");
|
||||
} else {
|
||||
$messaggio = "Errore: password non corretta!";
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<form name="login" action="login.php" method="post">
|
||||
<input type="password" name="password" value=""/> <input type="submit" value="Entra"/>
|
||||
</form>
|
||||
|
||||
|
||||
<?php
|
||||
if(isset($messaggio)) {
|
||||
echo $messaggio;
|
||||
unset($messaggio);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user