to match the entered username to an existing one in the DB, you must do a query to the db:
$q = SELECT * FROM users WHERE username='$enteredUsername'
$result = mysql_query($q);
if (!$result) {
echo "incorrect username";
} else {
// do something positive
}
to validate any field you need the name of the field:
if (strlen($_POST['subject']) == 0) {
echo "please enter a subject";
}
strlen() gets the chr count of the field value. There are several different ways you can validate a field. There are entire classes that check if an email is bogus or not. Type something like, "field validation PHP" in google and you'll see what I mean. Here is one for example:
http://simonwillison.net/2003/Jun/17/theHolyGrail/
Just a note, hide your URLs. Someone with too much time on their hands can exploit what you are trying to build, especially when it involves grown-up babies...or grown-up acting like babies...watever