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
1002 B

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