You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

38 lines
1.1 KiB

  1. <?php
  2. function connecte($base)
  3. {
  4. $hote="localhost";
  5. $utilisateur="ecomonde";
  6. $pass="proot";
  7. if(!isset($connexion))
  8. {
  9. $connexion=mysql_connect($hote,$utilisateur,$pass) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Connexion au serveur impossible !</div>");
  10. $db=mysql_select_db($base,$connexion) or die ("<div class='alert alert-danger'><strong>ERREUR : </strong>Selection de la base $base impossible !</div>");
  11. }
  12. mysql_query("SET NAMES UTF8");
  13. }
  14. function requete1l($sql)
  15. {
  16. $resultat=mysql_query($sql) or die("<div class='alert alert-danger'><strong>ERREUR : </strong>Requete $sql problematique !</div>");
  17. $ligne=mysql_fetch_array($resultat);
  18. return $ligne;
  19. }
  20. connecte("ecomonde");
  21. $pseudo=$_POST['pseudo'];
  22. $pass=$_POST['pass'];
  23. $email=$_POST['email'];
  24. $check_email=requete1l("SELECT * FROM membres WHERE email='$email'");
  25. if ($email = $check_email) {
  26. echo "Vous avez déjà un compte !";
  27. }
  28. else {
  29. $sql="INSERT INTO membres VALUES(NULL,'$pseudo','$pass','$email')";
  30. mysql_query($sql) or die("ERREUR !");
  31. if($sql) header("location:index.php");
  32. }
  33. ?>