<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="fr">
<head>
<title>Zone membre</title>
</head>
<body>
<h1>Zone membre</h1>
<?php
require_once('./classes/User.php');
$is_valid= false;
if (isset($_POST['sub'])) {
$user = new User();
$is_valid = $user->isValid($_POST['login'], $_POST['password']);
}
if ($is_valid) {
echo 'Vous êtes connecté<br>';
} else {
?>
<form method="post">
<?php
if (isset($_POST['sub'])) {
echo 'Utilisateur inconnu<br>';
}
?>
<fieldset>
<legend>Identification</legend>
<label>Identifiant:<input type="text" name="login"></label><br>
<label>Mot de passe:<input type="password" name="password"></label><br>
<input type="submit" name="sub" value="Ok">
</legend>
</form>
<?php
}
?>
</body>
</html>