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
| <?php
require_once('connexion.php');
$nom= mysql_real_escape_string(htmlspecialchars(trim($_POST['prenom'])));
$prenom= mysql_real_escape_string(htmlspecialchars(trim($_POST['prenom'])));
$passwd = ($_POST['passwd']);
$age = trim($_POST['age']);
$rue = mysql_real_escape_string(htmlspecialchars(trim($_POST['rue'])));
$ville =mysql_real_escape_string(htmlspecialchars(trim($_POST['ville'])));
$pays = mysql_real_escape_string(htmlspecialchars(trim($_POST['pays'])));
$tel= trim($_POST['prenom']);
$email= mysql_real_escape_string(htmlspecialchars(trim($_POST['email'])));
if(empty($nom) || empty($prenom) || empty($passwd) || empty($email) || empty($tel))
{
echo ' verifier le champ manquant ';
}
else
{
$sql="SELECT email FROM J_users WHERE email = '$email'";
$res= mysql_query($sql,$jeux);
if(mysql_num_rows($res)) // j'essaye de comparer qu'aucun membre n'existe déja
{
mysql_query("INSERT INTO j_users VALUES ('','".$prenom."','".$age."','".$nom."','".$rue."','".$ville."','".$pays."','".$tel."','".$email."','".md5($passwd)."')") or die(mysql_error());
}
else
{
echo 'cet email existe déja' ;
}
}
?> |
Partager