<?php
   
    // On demarre la session  
    session_start ();  
	
	include('database.php');
	DB_connexion(); 
     
	$sql="SELECT * FROM user_online WHERE login = '".$_SESSION['login']."' ";
	$result = mysql_query($sql);	
	$data = mysql_fetch_assoc($result);
	$sql = "UPDATE user_online SET connexion = 'offline' WHERE id = '".$data['id']."' ";
	$requete = mysql_query($sql); 
	 
    // On detruit les variables de notre session  
    //session_unset ();  
     
    // On detruit notre session  
    //session_destroy ();  
    
    // On redirige le visiteur vers la page d'accueil  
	$_SESSION['logged'] = "no";
	$_SESSION['login'] = "no";
	$_SESSION['soumission']= 0;
								
    $page_active = $_GET['page'];
    //header('location: .$page_active. ');   
	
	//print_r($_SESSION);
	$page_active = $_SESSION['page_active'];
	header("Location: $page_active");
   
    //echo "<script>window.opener.location.reload()</script>";
	//header('location: index.php');  
	

?> 

