From 4dd163139f9b86962c3f86cd5f331436b3514778 Mon Sep 17 00:00:00 2001
From: Elyrith
Date: Sat, 10 Aug 2013 01:17:23 -0400
Subject: [PATCH] Database-based login working for user/new.php.
---
includes/login.inc | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/includes/login.inc b/includes/login.inc
index 5a9184e..8e62561 100644
--- a/includes/login.inc
+++ b/includes/login.inc
@@ -1,35 +1,26 @@
You are a valid user!
";
-# echo "Your username is $_POST[username]
";
-# echo "Your password is $_POST[password]
";
- $_COOKIE['monkey'] = '1';
- setcookie('monkey',$_COOKIE['monkey']);
- session_start();
- session_register[login];$_SESSION[login] = '1';
- session_register[count];$_SESSION[count]++;
+ if (mysql_num_rows($result) === 1) {
+ unset($_POST['do']);
+ $_COOKIE['session'] = 1;
+ setcookie('session',$_COOKIE['session']);
} else {
unset($_POST['do']);
- echo "You are not authorized. Please try again.
";
+# $_COOKIE['session']++;
+ echo "Login failed. Please try again.";
include("login_form.inc");
break;
}
-
}
?>