Why is there errors here? =S

Discussion in 'PHP' started by XhennerzX, Aug 7, 2008.

  1. #1
    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
     
    XhennerzX, Aug 7, 2008 IP
  2. mallorcahp

    mallorcahp Peon

    Messages:
    141
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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 :

     
    mallorcahp, Aug 7, 2008 IP
  3. XhennerzX

    XhennerzX Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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}}
     
    XhennerzX, Aug 7, 2008 IP
  4. lowridertj

    lowridertj Well-Known Member

    Messages:
    2,882
    Likes Received:
    40
    Best Answers:
    0
    Trophy Points:
    195
    #4
    by the looks of it its running mc codes. did you purchase from mccodes.com?
     
    lowridertj, Aug 8, 2008 IP