1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| <?php
// Definition des constantes et variables
define('login','ingenieur');
define('password','epst2012');
$errorMessage = '';
// Test de l'envoi du formulaire
if($_POST) {
// Les identifiants sont transmis ?
if(!empty($_POST['login']) && !empty($_POST['password'])) {
// Sont-ils les mêmes que les constantes ?
if($_POST['login'] !== login) {
$errorMessage = 'Mauvais login !';
}
else if($_POST['password'] !== password) {
$errorMessage = 'Mauvais password !';
}
else
{
// On ouvre la session
session_start();
// On enregistre le login en session
$_SESSION['login'] = login;
// On redirige vers le fichier admin.php
header('Location:frameessai.htm');
exit();
}
}
else
{
$errorMessage = 'Veuillez inscrire vos identifiants svp !';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
<head>
<title>Formulaire d'authentification</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#FFFFFF">
<div align="center">
<div align="left">
<div align="center">
<div align="left">
<div align="center">
<pre><font size="6"><strong><img src="logo_epst_vide.png" width="98" height="55" /><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="490" height="53">
<param name="movie" value="EPST.swf" /> <param name="quality" value="high" />
<embed src="EPST.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="490" height="53"></embed></object>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="581" height="135"><param name="quality" value="high" />
<embed src="autentification.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="581" height="135"></embed></object></strong></font></pre>
</div>
</div>
</div>
</div>
</div>
<div align="center"> </div>
<form action="<?php echo htmlspecialchars($_SERVER['file:///D|/mmes%20besoins/Bureau_D/xampp/htdocs/projet/PHP_SELF']); ?>" method="post">
<div align="center">
<h1><strong><em>Identifier vous </em></strong></h1>
</div>
<fieldset><div align="center"><?php
// Rencontre-t-on une erreur ?
if(!empty($errorMessage)) {
echo htmlspecialchars($errorMessage);
}
?>
</div>
<pre><label for="login"> <strong> LOGIN :</strong> </label> <input type="text" name="login" id="login2" /></pre>
<pre> <strong><label for="password">Mot de Passe :</label><label for="password"> </label></strong><label for="password"> <input type="password" name="password" id="password" /></label></pre>
<div align="center">
<pre><input type="submit" name="submit" value=" Connexion " /></pre>
</div>
</fieldset>
</form>
</body>
</html> |
Partager