Hey thanks man!! I really appreciate all the help!! However, I'm still stuck

How would I create a checklogin or registration function? I've tried to do so, but it doesn't seem to work...
CODE
class login {
function ($username, $password)
{
$this -> username = mysql_real_escape_string(stripslashes($username));
$this -> password = mysql_real_escape_string(stripslashes($password));
//how would I check if the user has submitted it? I mean, if empty, return a message, else login the user. Same for a registration technique; return message if username is x amount of characters in length, else, register user.
On the index page,
$user = new User($_POST['Username'], $_POST['Password']);
//Lemme go back to something....
Back to the objects page,
var $username;
var $password;
function filter_var($username, $password) {
$this -> username = mysql_real_escape_string($username);
$this -> password = mysql_real_escape_string($password);
}
function check_var($username, $password) {
if(!$this -> username || !$this -> password)
{
print "You must enter a username and password in order to login. <br>";
}
//else??
}
Anyway, back to index.php...
We've already defined the username and password globals...
So..
$user -> filter_var($_POST['Username'], $_POST['Password']);
$user -> check_var($_POST['Username'], $_POST['Password']);
//kinda lost now :(
I want to be able to return a value if the user enters a wrong value or just simply hits the submit button. However, if the post is fine, submit the details or login the user and gather the content.
I would prefer to use globals if they were to pass through each function consistently (I.e. if the first function were to filter them, the other functions view them as filtered variables?)