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
|
<?php
$nomr=$_POST['nom_resp'];
$prenomr=$_POST['prenom_resp'];
$civil=$_POST['civilite'];
$emailr=$_POST['email_resp'];
$login=$_POST['login_entreprise'];
$pwd=$_POST['pass'];
$pwd2=$_POST['pass2'];
$val = $_POST['submit'];
$test = 0;
if($val == "Valider")
{
if((empty($nomr)) or (empty($prenomr)) or (empty($login)) or (empty($pwd)) or (empty($pwd2)))
{
echo"<META http-equiv='refresh' content='0; URL=inscription4.php'>";
}
else
{
if ($pwd == $pwd2)
{//connection a la base de donnees :
$cnx = mysql_connect("localhost","root","") or die("la connexion a échoué".mysql_error);
$ddb=mysql_select_db("ecom1");
$i=0;
//md5 pour le mot de passe
$p=md5($pwd);
$reslt=mysql_query("select * from authentif",$cnx);
while($auth=mysql_fetch_object($reslt))
{
if ($login == $auth->logine)
{$i++;}
}
if ($i==0)
{
//insertion des valeurs
$req= "insert into authentif values('','$nomr','$prenomr','$civil','$emailr','$login','$p','$test')";
mysql_query($req,$cnx);
mysql_close($cnx);
echo"<META http-equiv='refresh' content='0; URL=../inscriptioncpp.php?action=$login'>";
}
else
{
mysql_close($cnx);
echo"<META http-equiv='refresh' content='0; URL=inscription2.htm'>";}
}
else
{echo"<META http-equiv='refresh' content='0; URL=inscription3.htm'>";}
}
}
if($val == "Annuler")
{echo"<META http-equiv='refresh' content='0; URL=../../abonnement1.htm'>";}
?> |
Partager