<?php

// Begin the session
session_start();

// Log out user
if (strstr($_SERVER['QUERY_STRING'], 'logout'))
{
	remove_session();
	$_SESSION['user_logged_in'] = FALSE;
	
	// Redirect back to this page
	header('Location: login.php');
}

// Redirect a logged in user
if ($_SESSION['user_logged_in'])
{
	header('Location: otherpage.php');
}
?>