Hey everyone,
I have another issue with my login page...It is in the checkuser.php and after I register, get the automated email that directs me to a page where my account has been activated..and redirects me to a log in page..I put in my info that the email gives me and it says that I either have not "activated my account" (which I clearly have..) or I didn't put in my info (which I clearly did) so I'm not sure what I'm doing wrong. Any help would be GREATLY appreciated! Here is the check user.php:
<?php
/* Check User Script */
session_start(); // Start Session
include 'membership_db.php';
// Conver to simple variables
$username = $_POST['username'];
$password = $_POST['password'];
if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'logIn.html';
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='0'");
$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'");
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.html';
}
?>