<?php
session_start();
$utente="pablo";
$password="345"; /* inserire su questa riga la password voluta */
$cpablo="selezionato";
if ($_POST['cpablo'] <> $cpablo){
if (isset($_SESSION['pas'])) {
if (isset($_POST['logout'])) {
unset($_SESSION['pas']);
$messaggio = "Logout effettuato con successo! Arrivederci!";
header("Location: home.html");
} else {
header("Location: acceso.php");
}
} else {
if ((isset($_POST['password'])) and (isset($_POST['utente']))) {
if (($_POST['password'] == $password) and ($_POST['utente'] == $utente)){
$_SESSION['login2'] = "verificata";
header("Location: acceso.php");
} else {
$messaggio = "Errore: password non corretta!";
}
}
}
}else{
$_SESSION['login2'] = "verificata";
header("Location: home.html");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<head>
<title>Contacto</title>
<link rel='stylesheet' href='estilos.css'>
<style>
}
</style>
</head>
<body>
<div style="center: 0px; top: -100px; ">
<form action="pas.php" method="post" class='login'>
</br></br></br></br></br></br></br></br></br></br></br></br>
<p><label>Nome
<input type="text" id="utente" name="utente" value="" size="25" /></TD></label></p>
<p><label>Password <input type="password" id="password" name="password" value="" size="25" /></label></p>
<input type="submit" value="Invia"/>
</br></br>
<?php
if(isset($messaggio)) {
echo $messaggio;
unset($messaggio);
}
?>
</form>
</div>
<div style="right: 20px; position: absolute; top: 660px; "><input id="home" name="home" type="button" value="Home" onclick="window.open('home.html')" /></div>
</body>
</html>