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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
function Inscription()
{
if(!(empty($_POST['nom'])) AND !(empty($_POST['prénom'])) AND !(empty($_POST['dten'])) AND !(empty($_POST['adresse']))
AND !(empty($_POST['cdepost'])) AND !(empty($_POST['ville'])) AND !(empty($_POST['mail'])) AND !(empty($_POST['cnfmail']))
AND !(empty($_POST['identifiant'])) AND !(empty($_POST['pwd'])) AND !(empty($_POST['cnfpwd'])) AND !(empty($_POST['conditions'])))
{
$Valnom=htmlspecialchars($_POST['nom']);
$Valprenom=htmlspecialchars($_POST['prénom']);
$Valdten=htmlspecialchars($_POST['dten']);
$Valcoord1=htmlspecialchars($_POST['coord1']);
$Valcoord2=htmlspecialchars($_POST['coord2']);
$Valadresse=htmlspecialchars($_POST['adresse']);
$Valcdepost=htmlspecialchars($_POST['cdepost']);
$Valville=htmlspecialchars($_POST['ville']);
$Valmail=htmlspecialchars($_POST['mail']);
$Valcnfmail=htmlspecialchars($_POST['cnfmail']);
$Validentifiant=htmlspecialchars($_POST['identifiant']);
$Valpwd=htmlspecialchars($_POST['pwd']);
$Valcnfpwd=htmlspecialchars($_POST['cnfpwd']);
$Valconditions=htmlspecialchars($_POST['conditions']);
if(preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#",$Valmail))
{
if(preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#",$Valcnfmail))
{
if($Valmail == $Valcnfmail)
{
if($Valpwd == $Valcnfpwd)
{
if($Valconditions)
{
@mysql_connect("localhost","root","") or die("Impossible de se connecter:".mysql_error()) ;
mysql_select_db('eservice') or die("Impossible de se connecter:".mysql_error());
$sql="INSERT INTO utilisateurs (Nom,Prenom,Datenaissance,Coord1,Coord2,Adresse,Cdepost,Ville,Mail,Identifiant,Pwd,Id) VALUE('$Valnom','$Valprenom','$Valdten','$Valcoord1','$Valcoord2','$Valadresse','$Valcdepost','$Valville','$Valmail','$Validentifiant','$Valpwd','')";
$result=mysql_query($sql);
if(!$result)
{
die("Impossible d'exécuter la requête:".mysql_error());
}
mysql_close();
echo'<meta http-equiv="refresh" content="3; url=portail.php"/>';
}
}
else
{
echo'Vos Mots de passe ne sont pas identiques';
}
}
else
{
echo'Vos Adresses Email ne sont pas identiques';
}
}
else
{
echo'Votre Adresse Email confirmé n\'est pas correcte';
}
}
else
{
echo'Votre Adresse Email n\'est pas correcte';
}
}
if($_SESSION['Status']==0)
{
echo'
<h4 class="infospersonnelles">Informations Personnelles</h4>
<div class="hautgche">
<form method="post" action="inscription.php">
<label>Nom * :</label> <input type="text" name="nom" />
<br>
<label>Prénom * :</label> <input type="text" name="prénom" />
<br>
<label>Date de Naissance * :</label> <input type="text" name="dten" value="06/04/1989" />
<br>
<label>Coordonnées (Fixe) :</label> <input type="text" name="coord1" value="02.00.00.00.00"/>
</div>
<div class="hautdrt">
<label>Coordonnées (Mobile) :</label> <input type="text" name="coord2" value="06.00.00.00.00" />
<br>
<label>Adresse * :</label> <input type="text" name="adresse" />
<br>
<label>Code Postal * :</label> <input type="text" name="cdepost" />
<br>
<label>Ville * :</label> <input type="text" name="ville" />
<br>
</div>
<h4 class="infosutilisateur">Informations Compte Utilisateur</h4>
<div class="basgche">
<label>Identifiant * :</label> <input type="text" name="identifiant" />
<br>
<label>Mot de passe * :</label> <input type="password" name="pwd" />
<br>
<label>Confirmation Mot de passe * :</label> <input type="password" name="cnfpwd" />
<div class="condition">
<input type="checkbox" name="conditions" /><label class="conditions">Vous avez lu est accepté <a href="#">les conditions générales d\'utilisation.</a></label>
</div>
<p>* : Champs obligatoires.<p>
</div>
<div class="basdrt">
<label>Adresse Email * :</label> <input type="text" name="mail" value="service@serviceacces.fr"/>
<br>
<label>Confirmation Adresse Email * :</label> <input type="text" name="cnfmail" value="service@serviceacces.fr"/>
<br>
<div class="conf">
<input type="submit" value="Confirmation" name="conf" />
</div>
</form>
</div>
';
}
else
{
echo'
<div class="redirect">
<h4>Information</h4>
Vous êtes déjà inscrit.
<br>
Vous allez être redirigé dans 3 secondes.
<br>
<br>
<br>
<meta http-equiv="refresh" content="3; url=portail.php"/>
<a href="portail.php">Ne pas attendre</a>
</div>
';
}
}
?> |
Partager