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
| <FORM name="formulaire" action="acceuil.php" method="post">
<p>
<label for="numeroAdherant">Numéro Adhérant : </label><input type="text" size="10" maxlength="10" name="numeroAdherant" id="numeroAdherant"><br><br>
<label for="password">Mot de Passe : </label><input type="text" size="10" maxlength="10" name="password" id="password">
</p>
<p >
<input Type="submit" Value="ENVOYER" name="VALIDATION">
<input Type="reset" Value="ANNULER" name="ANNULER">
</p>
</FORM>
<div id="splash">
<h5>sinon, créez votre compte:</h5>
<p class="texte0"><a href="SaisieAdherant.html">Créer votre compte</a> </p>
</div>
</body>
<?php
if (isset ($_POST['VALIDATION'])){
$conn=mysql_connect('localhost', 'root', '');
//verifier que la connexion fonctionne
if(!$conn) die ("erreur de connection à la base de données");
mysql_select_db ('bibliotheque', $conn);
$_SESSION['$numeroAdherant'] = $_POST['numeroAdherant'] ;
$_SESSION['password'] = $_POST['password'];
//On test si le numeroAdherant et le password existent
$sql_selection2 = "SELECT count(IdAdherant) FROM adherant WHERE (IdAdherant='".$_SESSION['$numeroAdherant']."' AND password='".$_SESSION['password']."')";
$req2 = mysql_query($sql_selection2) or die('Erreur lors du test de duplication sur la table adherant !<br />'.$sql_selection2.'<br />'.mysql_error());
$data2 = mysql_fetch_array($req2);
//Si le numeroAdherant et le password n'est pas présente
if ($data2[0] == 0)
{
echo( "<script language=\"javascript\">alert(\"Erreur de numeroAdherant/Mot de passe!\");</script>" );
}
//On ferme la connexion
mysql_close();
}
?> |
Partager