Check for all errors at the top of your script and set variables like error1=true; error2=true; if there is any error. Then within the form WHERE you want the error to print out on the screen, do like if(isset($error1)==true)echo'User name not found';
if(isset($error2)==true)echo'User name/password did not match';
There are many ways to do this, this is just one example.