View Single Post
Old 05-07-2008, 08:55 PM   #2 (permalink)
xenon
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

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.
xenon is offline  
Reply With Quote
The Following User Says Thank You to xenon For This Useful Post:
Jmz (05-07-2008)