Follow me on Twitter to receive updates, free scripts and ongoing announcements!

PHP logout script

Written by Codes Tips on April 25, 2009 – 4:19 pm -

This is a short php logout script for logging out a user that you previously logged in through your website:

<?
function redirect($url)
{
  echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=$url\">";
  echo "Click <a href=$url>".here.'</a> if you not get redirected';
}
  session_start();//initialize the session data
  $_SESSION['session_user'] = '';//clear the session user that you created on login
  unset($_SESSION['session_user']);//destroy the session variable of the user
  //redirect to home page
  redirect('index.php');
?>

Tags: ,
Posted in Codes, PHP/MYSQL |

Leave a Comment

You must be logged in to post a comment.


Plugintaylor.com - Plugintaylor and Wordpress Mu