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
| <?
if ( isset($_POST) && (!empty($_POST['pseudo'])) && (!empty($_POST['password'])) && (!empty($_POST['email'])) && (!empty($_POST['calcul'])) )
{
$serveur="sql.free.fr";
$user="ffff";
$mdp="ssssssss";
mysql_connect($serveur,$user,$mdp);
mysql_select_db($user);
$calcul=($_POST['calcul']);
$pseudo=htmlentities(mysql_real_escape_string($_POST['pseudo']));
$password=htmlentities(mysql_real_escape_string($_POST['password']));
$email=htmlentities(mysql_real_escape_string($_POST['email']));;
$r=mysql_query('SELECT * FROM compte1 WHERE pseudo= "'.$pseudo.'" ');
$verif = mysql_num_rows($r);
if ($verif==0)
{
mysql_query("INSERT INTO compte1(id, pseudo, password, email) VALUES ('', $pseudo, $password, $email)");
mysql_close();
echo "C est bon";
}
elseif
{
$r=$a+$b;
if ($r != $calcul)
{
echo 'NON erreur de calcul';
}
}
else
{
echo 'Le pseudo est le meme désolé';
}
}
else
{
echo 'Tous les champs NON REMPLIS';
} |
Partager