This should be a good starter project to bring you out of "biggest n00b" status.
You're going to want to learn about sessions and MySQL (assuming that's the db you're using) database queries. Learn about sessions here: http://www.php.net/manual/en/ref.session.php , and mysql functions here: http://www.php.net/manual/en/ref.mysql.php .
Here is some pseudo code to get you started:
session_start();
session_register('username');
session_register('password');
$cid = mysql_connect("localhost", "yourusername", "yourpassword");
if (isset($username)) {
$sql = " SELECT * from database.users_table WHERE username = '$username' ";
$retid = mysql_query($sql, $cid);
$row = mysql_fetch_array($retid);
$checkpassword = $row["password"];
if ($checkpassword == $password) {
echo("Welcome $username");
}
else {
echo("authentication failed");
}
}
else {
// Output login page
}
That should get you started. The code may have errors, since I wrote it in about 2 minutes, so I wouldn't use it as is, just use it to get a feel for what you need to do.