summary refs log tree commit diff stats
path: root/admin/login.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 18:05:42 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-21 18:05:42 -0500
commitd0601a55010cd9fe2f2587ce157ce059e5da732e (patch)
tree6c56f73f6d2dfa1bbaab5c053321458014709377 /admin/login.php
parent877fa5a38fefe2bdd0e00768b6ec4b52a81d7a69 (diff)
downloadpillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.gz
pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.bz2
pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.zip
Started admin panel
Diffstat (limited to 'admin/login.php')
-rw-r--r--admin/login.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/admin/login.php b/admin/login.php new file mode 100644 index 0000000..f938664 --- /dev/null +++ b/admin/login.php
@@ -0,0 +1,30 @@
1<?php
2
3if (!isset($_GET['submit']))
4{
5
6?>
7<FORM ACTION="/admin/login.php?submit=" METHOD="POST">
8Username: <INPUT TYPE="text" NAME="user"><BR>
9Password: <INPUT TYPE="password" NAME="pass"><BR>
10<INPUT TYPE="submit"></FORM>
11<?php
12
13} else {
14 $getconfig = "SELECT * FROM config WHERE name = \"username\" OR name = \"password\" ORDER BY name DESC";
15 $getconfig2 = mysql_query($getconfig) or die($getconfig);
16 $username = mysql_fetch_array($getconfig2);
17 $password = mysql_fetch_array($getconfig2);
18
19 if (($username['value'] == $_POST['user']) && ($password['value'] == md5($_POST['pass'])))
20 {
21 $_SESSION['username'] = $_POST['user'];
22
23 header('Location: /admin/');
24 exit;
25 } else {
26?><H2>Incorrect login</H2><?php
27 }
28}
29
30?>