From f0173a728245241b083a823de026c3b9587d5098 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 18 Feb 2014 00:14:54 +0100 Subject: logout --- www/login.php | 13 +++++++++++++ www/register.php | 10 +++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/login.php b/www/login.php index c1d3207..e9c7c93 100644 --- a/www/login.php +++ b/www/login.php @@ -48,9 +48,22 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { /*Prints the GET version*/ + foreach ($_GET as $argument => $value) { + if(preg_match("/logout/",$argument)){ + session_destroy(); + header("Refresh: 0; /login?success"); + exit; + } else { + if(preg_match("/success/",$argument)) + $logout="Successfull loged out!"; + } + } + if($_SESSION["login"]){ header("Refresh: 0; /"); } else { + echo $logout; + echo "