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.

session.php 1016 B

10 years ago
10 years ago
10 years ago
10 years ago
1234567891011121314151617181920212223242526272829303132333435363738
  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=sha1($_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?msg=3");
  27. else
  28. {
  29. extract($ligne);
  30. $_SESSION['status']=$id;
  31. header("location:index.php");
  32. }