05-07-2008, 08:55 PM
|
#2 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
After this line:
PHP Code:
$result = mysql_query($query);
you don't need to go through the result (which, btw, should be only one). Instead, you can easily do this:
PHP Code:
if(mysql_num_rows($result) > 0) { echo 'successfully logged in!'; } else { echo 'wrong username and/or password'; }
And an advice: don't store the password in clear text in your database. Instead, use a hashing algorithm like md5 or sha1.
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|