My problem is when i enter a username that’s in my database it should go to another page link but when u type in a username that doesn’t exists it should stay at the login page and display the error “Username is wrong”. But all my form does is display the error how do i make it so if username is right it should go to another page?Here’s my login page code:
[php]
".mysql_error()); $row = mysql_fetch_array($res); if ($row['username'] != $user) { $errors[] = 'Wrong username.Try again!'; }else{ header("location:home.php"); } } if(!empty($errors)) { foreach ($errors as $error) { echo '',$error,''; } }else{ echo "Success"; } } ?>
Back to homepage
Username:
Password:
|
[/php]