This question already has an answer here:
Answer
Solution:
Because there is no result with your query. It returns FALSE and you try to access false as an array.
So test if row is filled with data
(see updated if statement).
Btw. do echo after header.
if($row && $row['useremail']==$useremail && $row['password']==$password){
header('refresh:1;dashboard.php');
echo $success='Login Successful';
} else{
echo 'Login Failed';
}
Hint: use prepared statements
$select = $pdo->prepare("SELECT * FROM tbl_user WHERE useremail=? AND password=?");
$select->execute([$useremail, $password]);
Warning
Do never save passwords in plain text. Use encryption.
Source