From f6be9edd401664d95e60ae3c81aeaf36723ba891 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 8 Feb 2009 04:48:53 +0000 Subject: added login capability --- login.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 login.php (limited to 'login.php') diff --git a/login.php b/login.php new file mode 100644 index 0000000..02015e7 --- /dev/null +++ b/login.php @@ -0,0 +1,40 @@ +\n"; +echo "\n"; + +if (isset($_POST['login'])) +{ + if(check_user($_POST['username'], $_POST['password'])) + { + $_SESSION['logged_in'] = true; + $_SESSION['username'] = $_POST['username']; + } + else + { + echo ''."\n"; + } +} +else if (isset($_POST['logout'])) +{ + session_destroy(); + $_SESSION['logged_in'] = false; +} + +if (isset($_SESSION['logged_in']) && $_SESSION['logged_in']) +{ + echo ''."\n"; + echo ''."\n"; +} +else +{ + echo ''."\n"; +} +echo ""; -- cgit v1.2.1