Earn Resources
Moderator: General Moderators
you need to run a query against the db to get the user details that are valid, and then compare the ones submitted to these to see if they are correct.
basic example
basic example
Code: Select all
if($_REQUEST['username']!=""&&$_REQUEST['password']!=""){
$sql = "SELECT * FROM users WHERE users.username='".$_REQUEST['username']."' AND users.password='".$_REQUEST['password']."'";
$result = mysql_query($sql);
$num = mysql_num_rows($result);
if($num!=0){
// do login stuff
}
else{
// user not logged in
}
}
else{
// blank login details do something
}