Hello Everyone,

I hava design just a register page and a login page ,a user can register then login..during registration i used the password() for password field insert value to database. During login I used as password('_POST[pass]') and comparing with the inserted value but its not working ....
I just tried this ...

<?PHP
if(isset($_POST))
{
$my_con=mysql_connect("localhost","root","xyz");
$my_db= mysql_select_db("xy",$my_con);
$sql= "SELECT * FROM member WHERE loginName ='".$_POST[user]."' AND password = password('".$_POST."')";
$my_user= mysql_query($sql);
if($db_field = mysql_fetch_assoc($my_user))
{
print $db_field."<br>";
print $db_field;
print $db_field;
}
else
print "Username or Password is incorrect";
}
?>

so please help me...

Recommended Answers

All 2 Replies

Thanks a lot smantscheff... its working..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.