Hi everyone,

Im making a game that requires a login.

Ive got stuck on a problem;

When a user tries to log in, it wont accept it, its in the database, the script checks the database, but it still says no

Here is my login check:

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);
$domain = $_SERVER['REMOTE_ADDR'];


if((!$username) || (!$password)){
    echo "You have not submitted one or more fields <br />";

$sql = mysql_query("SELECT * FROM user_info WHERE username='$username' AND password='$password' LIMIT 1");
$login_check = mysql_num_rows($sql);

if ($login_check > '1'){

        ini_set(session.cookie_lifetime, "3600");
        $_SESSION['username'] = $username;
        $_SESSION['email_address'] = $email_address;

         $timestamp = time();
$timeout = $timestamp-$timeoutseconds;
$cool = gmdate('Y-m-d h:i:s');
mysql_query("UPDATE user_info SET lastlogin='$cool' WHERE username='$username'");
mysql_query("UPDATE user_info SET online='$timestamp' WHERE username='$username'");

mysql_query("UPDATE user_info SET ip='$domain' WHERE username='$username'");

<meta http-equiv="Refresh" content=0;url=index.php>

} else {
    echo "wrong username/password combination or account not yet activated<br />
    <br />";
    include 'splash.php';

You can see an example here: craigs-space.freehostia/rm/splash.php

The register works, so you can create accounts

or use:


It will come up with a problem, i dont know whats causing it :s

any help would be appreciated

This question has already been answered. Start a new discussion instead.