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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
| <?php
$bdd = new PDO('mysql:host=127.0.0.1;dbname=espace_membre','root','');
if(isset($_POST['forminscription']))
{
if(!empty ($_POST['pseudo']) AND !empty($_POST['mail']) AND !empty($_POST['mail2']) AND !empty($_POST['mdp']) AND !empty($_POST['mdp2']))
{
$pseudo = htmlspecialchars($_POST['pseudo']);
$mail = htmlspecialchars($_POST['mail']);
$mail2 = htmlspecialchars($_POST['mail2']);
$mdp = sha1($_POST['mdp']);
$mdp2 = sha1($_POST['mdp2']);
$pseudolengh = strlen($pseudo);
// if($pseudolengh <= 255);
if ($mail == $mail2);
{
}
(ligne22) else{
$erreur ="Vos adresses mails ne correspondent pas";
}
{
if($mdp == $mdp2);
{
}
else
{
$erreur = "Vos mots de passe ne correspondent pas";
}
}
}
else
{
$erreur= "Tous les champs doivent être remplies";
}
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width= device-width, initial-scale=1.0">
<title>Page Contact</title>
<link rel="stylesheet" href="contact.css">
<link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet">
</head>
<body>
<div class= "contact-title">
<h1>Inscription </h1>
<br /><br />
</div align="center">
<br/><br/><br/>
<form method="POST" action="">
<table>
<div>
<td>
<tr>
<label for="pseudo">
Pseudo: </label>
<input type="text" Splaceholder="Votre pseudo" id="pseudo" name="pseudo" />
</td> <br/>
</tr>
<td align="right"><br>
<tr>
<label for="mail">
Mail: </label>
<input type="email" placeholder="Votre mail" id="mail" name="mail" />
</td>
</tr> <br/>
<td><br>
<tr>
<label for="Confirmation du mail">
Confirmation Mail:</label>
<input type="email" placeholder=" Confirmez votre email" id="mail2" name="mail" />
</td>
</tr> <br/>
<td align="right">
<tr>
<label for="mdp">
Mot de passe :</label>
<input type="password" placeholder=" Votre mot de passe" id="mdp" name="mdp" />
</td>
<td align="right"> <br>
<tr>
<label for="mdp2">
Confirmation de votre Mot de passe :</label>
<input type="password" placeholder=" Confirmation de votre mot de passe" id="mdp2" name="mdp2" />
</td><br/>
</tr>
<tr>
<td align="right"></td>
<td> <input type="submit" name="forminscription" Value="Je m'inscris"/>
</td>
</div>
</table>
</form>
<?php
if(isset($erreur))
{
echo'<font color="red">' .$erreur. "</font>";
}
?>
</div>
</body>
</html> |
Partager