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
| <? include'../connexion_bdd.php';
$login = $_POST["login"] ;
$pass = $_POST["mot_de_passe"];
$sql = "SELECT * FROM `table_client` WHERE `login` LIKE \"%$login%\" && `pwd` LIKE \"%$pass%\" ";
$query = mysql_query($sql);
while($client = mysql_fetch_assoc($query))
{
$toto =$client['login'];
$tata =$client['pwd'];
if (($login == $toto)&&($pass == $tata))
{
echo'afficher info bdd pour le client logger';
}
else
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<title>Page protégée par mot de passe</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<SCRIPT LANGUAGE="JavaScript">
/* On crée une fonction de verification */
function verifForm(formulaire)
{
if((formulaire.login.value == "") || (formulaire.mot_de_passe.value == "")) /* on detecte si les champs email et password sont vide */
alert('Remplissez le champs !!'); /* dans ce cas on lance un message d'alerte */
else
formulaire.submit(); /* sinon on envoi le formulaire */
}
</SCRIPT>
</head>
<body>
<form action="spectateur.php" method="post">
<table align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="10" width="40%">
<tbody>
<tr>
<td width="110"><strong>Login*</strong></td>
<td><input name="login" size="20" maxlength="250" type="text"></td>
</tr>
<tr>
<td width="110"><strong>Mot de passe*</strong></td>
<td><input name="mot_de_passe" size="20" maxlength="250" type="password"></td>
</tr>
<tr>
<td> </td>
<td align="right"><INPUT type=submit VALUE="Envoyer" onClick="verifForm(this.form)"></td>
</tr>
<tr valign="bottom">
<td colspan="2" height="15"><div align="right"><a href="mailto:contact@blabla.com">Vous
avez oublié votre mot de passe ?</a></div>
<br><br>
Si vous n'etes pas encore inscrit cliquez <a href="formulaire.html">ICI</a> !
</td>
</tr>
</tbody></table>
</form>
</body>
</html>
<?
}
}
?> |
Partager