1<?php 2// $Id$ 3 4if (isset($_GET['action']) && $_GET['action'] == 'logout') { 5 session_start(); 6 session_destroy(); 7 echo 'You have successfully logged out. Redirecting....'.PHP_EOL; 8 echo '<meta http-equiv="refresh" content="5;http://php.net/"/>'.PHP_EOL; 9 exit(0); 10} 11 12require 'login.inc'; 13 14head(); 15?> 16<!-- login.inc does exit() if the user isn't logged in --> 17<p>You are already logged in</p> 18<?php 19foot(); 20?> 21