From 59b4a14950afaf384475a7a632cbb6fb3bdacb15 Mon Sep 17 00:00:00 2001 From: yugi Date: Thu, 25 Jul 2013 18:28:07 +0530 Subject: [PATCH] Bug fix --- login.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/login.php b/login.php index a197154..6b56f88 100644 --- a/login.php +++ b/login.php @@ -6,6 +6,9 @@ * * Codejudge Login page */ + + error_reporting(1); + require_once('functions.php'); if(loggedin()) header("Location: index.php"); @@ -17,7 +20,7 @@ else { // code to login the user and start a session connectdb(); - $query = "SELECT salt,hash FROM users WHERE username='".$username."'"; + $query = "SELECT salt,hash FROM users WHERE username=".$username; $result = mysql_query($query); $fields = mysql_fetch_array($result); $currhash = crypt($_POST['password'], $fields['salt']); @@ -35,7 +38,7 @@ else { // create the entry in the users table connectdb(); - $query = "SELECT salt,hash FROM users WHERE username='".$username."'"; + $query = "SELECT salt,hash FROM users WHERE username=".$username; $result = mysql_query($query); if(mysql_num_rows($result)!=0) header("Location: login.php?exists=1"); @@ -54,7 +57,7 @@ - <?php echo(getName()); ?> Login + Login @@ -96,7 +99,7 @@ - + Welcome to the CodeJudge