alright, that fixed the script, but now their is another problem that I am dealing with. For some reason the script isn't posting the username to the script. I've changed it a little bit, so that I could try and figure out the problem, but allas, my newbieness has won the battle again. Here is what I have for the checkuser.php now:
<?
session_start();
include("db.inc");
$username = $_POST['username'];
$password = $_POST['password'];
if((!$username) || (!$password)) {
echo "Please enter ALL of the information! <br />";
echo $username;
echo "<br />";
echo $password;
echo "<br />";
include("login_form.html");
exit();
}
$password = md5($password);
$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);
}
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'");
header("Location: login_success.php");
}
} 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("login_form.html");
}
?>
And here is the form that is passing the information to the script:
<html>
<body>
<center>
<form action="checkuser.php" method="post">
<table width="50%" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="22%">Username</td>
<td width="78%"><input name="username" type="text"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password"></td>
</tr>
</table>
<input type="submit" name="submit" value="Submit"></td>
</form>
</center>
</body>
</html>
When I execute the script, it is giving me the first error (Please enter all the information), and then it is only echoing back my password, but not the username. What is wrong here?
Thanks for the help guys.