There are plenty of tutorials on this topic. Do a search on google or your favorite seach engine.
It involves working with forms (plenty tutorials) and reacting on variables.
A good place to start might be Devshed.com.
In short:
build a form, submit the form. Look up in the db if the username exists and if the password is correct. If yes (if clause), show the data. If not (else clause) show the other text.
Good luck