Thankyou very much. Here is the whole page setup I am using. I'm a newbie and confused lol Thanks again!
<?
session_start();
header("Location: http://Mysite.com/login_success.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>checkuser</title>
</head>
<body>
<?
include 'db.php';
$username = $POST['username'];
$password = $POST['password'];
if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'http://www.Mysite.com/login_form.htm';
exit();
}
// Convert password to md5 hash
$password = md5($password);
// check if the user info validates the db
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('first_name');
$SESSION['first_name'] = $first_name;
session_register('last_name');
$SESSION['last_name'] = $last_name;
session_register('email_address');
$SESSION['email_address'] = $email_address;
session_register('special_user');
$SESSION['user_level'] = $user_level;
mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'");
}
} else {
echo "You could not be logged in! Either the username and password do not match or you have not validated your membership!<br />
Please try again!<br />";
include 'http://www.Mysite.com/login_form.htm';
}
?>
</body>
</html>