I'm trying to use an authencation method with php/mysql.
The user fills in 3 fields in the form:
$username
$password
$id
I want the mysql database to search for a matching username. Then check if the id and password match. Print out another 3 variables.
$db_username
$db_password
$db_id
then use an if statement to check if all of them match. If so, then the person is allowed in. This is the method I want to use.
The database is called Secure_Db and the table is called Secure_Tb
here is what I have but it doesn't work...
$auth = "SELECT db_username FROM Secure_Tb WHERE db_password = '$pw' AND db_id = '$id'";
if ($username == "$db_username" && $password == "$db_password" && $id == "$db_id") {
header("Location: http://www.securezone.com");
} else {
header("Location: http://www.notsecure.com");
}