Aide inscription

Chabanus Messages postés 1026 Statut Membre -  
arthezius Messages postés 3756 Statut Membre -
Bonjour,
Je n'arrive pas a insérer dans la bdd. Je ne sais pas ou est l'erreur au juste ?!

if(isset($_POST['login'])){ 
	if(($_POST['login'] == "") || ($_POST['pass'] == "") || ($_POST['mail'] == "") || ($_POST['nom'] == "")|| ($_POST['prenom'] == "")|| ($_POST['pays'] == "") || ($_POST['jour'] == "00") || ($_POST['mois'] == "00") || ($_POST['annee'] == "0000")  )
       { 
		header("Location:inscription.php?erreur=empty");
	}
	
	else if($_POST['pass'] == $_POST['pass2'])
{
		// on passe toutes les variables $POST en variables
		$privilege = htmlentities($_POST['privilege']);
		$login =htmlentities( $_POST['login']);
		$pass = htmlentities(md5($_POST['pass'])); 
		$mail = htmlentities($_POST['mail']);
		$nom = htmlentities($_POST['nom']);
		$prenom = htmlentities($_POST['prenom']);
		$pays = htmlentities($_POST['pays']);
		$jour = htmlentities($_POST['jour']);
               $mois = htmlentities($_POST['mois']);
               $annee = htmlentities($_POST['annee']);
		
	if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$", $mail)) 
	{
		$add_user = sprintf("INSERT INTO utilisateurs (login, pass, mail, nom, prenom,privilege,paysn,jour,mois,annee) VALUES ('$login', '$pass', '$mail','$nom', '$prenom','user','$pays','$jour','mois','$annee')");
  		mysql_select_db($database_dbprotect, $dbprotect);
  		$result = mysql_query($add_user, $dbprotect) or die(mysql_error());
		header("Location:validation.php?add=ok"); 
	}
}
	else
       {

		header("Location:inscription.php?erreur=pass||erreur=mail"); 
	}
	
}

Merci de m'aider
cordialement
A voir également:

1 réponse

arthezius Messages postés 3756 Statut Membre 475
 
Voici un code qui pourra peut-être t'inspirer: http://www.lephpfacile.com/howto/10-comment-faire-un-espace-membre-en-php
0