diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-21 18:05:42 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-21 18:05:42 -0500 |
commit | d0601a55010cd9fe2f2587ce157ce059e5da732e (patch) | |
tree | 6c56f73f6d2dfa1bbaab5c053321458014709377 /admin/login.php | |
parent | 877fa5a38fefe2bdd0e00768b6ec4b52a81d7a69 (diff) | |
download | pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.gz pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.tar.bz2 pillowcase-d0601a55010cd9fe2f2587ce157ce059e5da732e.zip |
Started admin panel
Diffstat (limited to 'admin/login.php')
-rw-r--r-- | admin/login.php | 30 |
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 | |||
3 | if (!isset($_GET['submit'])) | ||
4 | { | ||
5 | |||
6 | ?> | ||
7 | <FORM ACTION="/admin/login.php?submit=" METHOD="POST"> | ||
8 | Username: <INPUT TYPE="text" NAME="user"><BR> | ||
9 | Password: <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 | ?> | ||