123456789101112131415161718192021222324252627282930 |
- <?php
- if(!@$_SESSION['session']){
- session_start();
- }
- $session=htmlspecialchars(formulaires($_SESSION['session']));
- if(!@$_SESSION['session'])
- {
- header('Location:index.php?error=connection');
- return false;
- }
-
- $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
- $verif=mysql_num_rows($verif);
- if($verif == 0)
- {
- header('Location:index.php?error=connection');
- session_unset();
- session_destroy();
- return false;
- }
-
- $sql=mysql_query("SELECT * FROM user WHERE session='$session'") or die ('error : '.mysql_error());
- while ($resultat = mysql_fetch_array($sql) )
- {
- $email = $resultat['email'];
- $username = $resultat['username'];
- $id_user = $resultat['id_user'];
- }
- ?>
|