Hi, I made a login/pass system using sessions and it works fine if I add the username/password myself through PHPMyAdmin. However, i'm having problems with my Registration page. When i tested it out, the password did get inserted into the database but it was not encrypted and therefore when I tried to login with than username/password, it failed since it looks for pass=password('$password')
How do I code the INSERT portion on the registration page? This is how I have it setup now:
$query = "insert into auth values
('0', '".$name."', '".$password."')";
$result = mysql_query($query);
I tried putting password('$password) but that gave me an error.
This is how the signup portion is coded:
$query = "select * from auth
WHERE name='$userid' AND pass=password('$password')";
$result = mysql_query($query, $connect);
if (mysql_num_rows($result) >0 )
{
list($auth_ID,$name,$pass)=mysql_fetch_row($result);
// if they are in the database register the user id
$_SESSION['valid_user']=$name;
$_SESSION['id']=$auth_ID;
}
Can somene tell me how I would insert an encrypted password through a form?