Hey, i recently got a mafia game script and it wont login people, but it will register them. Everytime I try and login, it comes up with: wrong username/password or account is not activated. The PHP is as follows logincheck.php <? session_start(); header("Cache-control: private"); include 'includes/db_connect.php'; if (!$_SESSION['username'] || !$_SESSION['email']){ $username = $_POST['username']; $password = $_POST['password']; $username = strip_tags($username); $password = strip_tags($password); $ip = $REMOTE_ADDR; $domain = $_SERVER['REMOTE_ADDR']; $username=strtolower($username); if((!$username) || (!$password)){ echo "You have not submitted one or more fields <br />"; }else{ ///check INFO $sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); $login_check = mysql_num_rows($sql); ///other if ($login_check > '1'){ ini_set(session.cookie_lifetime, "3600"); session_register('username'); $_SESSION['username'] = $username; session_register('email_address'); $_SESSION['email_address'] = $email_address; $timestamp = time(); $timeout = $timestamp-$timeoutseconds; $cool = gmdate('Y-m-d h:i:s'); mysql_query("UPDATE users SET lastlogin='$cool' WHERE username='$username'"); mysql_query("UPDATE users SET online='$timestamp' WHERE username='$username'"); mysql_query("UPDATE users SET ip='$domain' WHERE username='$username'"); ?> <meta http-equiv="Refresh" content=0;url=mb.php> <? } else { echo "wrong username/password combination or account not yet activated<br /> <br />"; include 'login.php'; }}} ?> I have no idea why it's doing it, because in PHPMYADMIN, it says what the user is, the password, and i can set the account to active, but it still come up with error. Please help Hennerz
Looks to me as if it is checking for more than (> '1') one user with the same username and password combination. Also, should check for an integer not a string maybe. Try this : or this :
oh thanks man! it works now! i wish i could hire you lol. Thanks!! all those hours of trying finally paid off! Thanks a lot mallorcahp {{TOP RATED USER}}