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 85 86 87 88 89 90 91 92 93 94 95 96
|
<?php
$login = "";
$MotDePasse = "";
$autorisation = false;
if(isset($_POST['login']))
$login=$_POST['login'];
if(isset($_POST['MDP']))
$MotDePasse=$_POST['MDP'];
if(($login<>"") && ($MotDePasse<>""))
{
mysql_connect('localhost', 'root', '');
mysql_select_db('bob');
$sqlLOGIN="SELECT * FROM utilisateur
WHERE Mot_De_Passe='$MotDePasse'";
$reqLOGIN=mysql_query($sqlLOGIN);
if(mysql_num_rows($reqLOGIN)==1)
{
$ligneRetour = mysql_fetch_array($reqLOGIN);
$loginRetour = $ligneRetour['Login'];
$passRetour = $ligneRetour['Mot_De_Passe'];
if(($loginRetour==$login)&&($passRetour==$MotDePasse))
{
$autorisation = true;
}
}
mysql_close();
if($autorisation)
{
header("Location:accueil.php");
}
else
{
header("Location:index.php");
}
}
?>
<script type="text/javascript">
<!--
function valider()
{
if(document.identification.login.value == "") {
alert("Veuillez entrer votre login SVP!");
document.identification.login.focus();
return false; }
if(document.identification.MDP.value == "") {
alert("Veuillez entrer votre mot de passe SVP!");
document.identification.MDP.focus();
return false; }
}
-->
</script>
<?php include("entete.php"); ?>
<div class="feature">
<h1 style="font-size: 36px; color: #FF0000;">SAISISSEZ VOTRE LOGIN ET VOTRE MOT DE PASSE !!</h1>
<form name="identification" method="POST" onsubmit="return valider()">
<table align="center" width="60%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="49%"><div align="center" style="color: #0000FF"><strong>Login:</strong></div></td>
<td width="51%"><input type="text" name="login" id="login"></td></tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td width="49%"><div align="center" style="color: #0000FF"><strong>Mot de passe:</strong></div></td>
<td width="51%"><input type="text" name="MDP" id="MDP"></td></tr></table>
<br><br>
<table align="center" width="60%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="40%"><div align="center"><input name="Valider" type="submit" value="Valider" />
</div></td></tr></table>
</form>
</div>
<?php include("pied.php"); ?> |