CMS ultra léger au style oldschool, projet de la communauté Kalaïn Hundin.

verifications.php 813B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. if(!@$_SESSION['session']){
  3. session_start();
  4. }
  5. $session=htmlspecialchars(formulaires($_SESSION['session']));
  6. if(!@$_SESSION['session'])
  7. {
  8. header('Location:index.php?error=connection');
  9. return false;
  10. }
  11. $verif=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error()); //on vérifie si il existe une entrée avec cet identifiant
  12. $verif=mysql_num_rows($verif);
  13. if($verif == 0)
  14. {
  15. header('Location:index.php?error=connection');
  16. session_unset();
  17. session_destroy();
  18. return false;
  19. }
  20. $sql=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error());
  21. while ($resultat = mysql_fetch_array($sql) )
  22. {
  23. $email = $resultat['email'];
  24. $username = $resultat['username'];
  25. $id_user = $resultat['id_user'];
  26. }
  27. ?>