Md5 Login page problem!
Posted: Sat Jul 01, 2006 5:23 pm
Weirdan | Please use
when I do echo "$count"; give me always 0 with the password
What I am doing wrong?
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello this is my first post on this forum...
Here it go!
Ok I encrypted my password on the page Register.php
In login.php I made script to encrypt the password and then look if does match or not with the Database
My problem is there they match but that not working wellCode: Select all
<?
include "configuration.php";
$db = mysql_connect($host, $login_php, $password);
$basedados = mysql_select_db($database);
$pass = md5($pass);
$check = mysql_query("SELECT * FROM `$table` WHERE login = '$login' AND pass = '$pass'", $db);
$count = mysql_num_rows($check);
if ( $count == 1 ) {
echo "Welcome User";
} else {
echo "Login fail";
}
?>What I am doing wrong?
Weirdan | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]