Jump to content
Fórum Script Brasil
  • 0

Erro de login


Yuri Vidal

Question

Por que em uma página o login é reconhecido e em outra não?

por exemplo eu estou logando normalmente, porém na página me.php não carrega meus dados, agora se eu clicar para ver ir na pagina characters para ver meus avatares está funcionando corretamente.

segue abaixo o código do login.php

<?php
ob_start();
session_start();  
define('USERNAME_REQUIRED', FALSE);
define('ACCOUNT_REQUIRED', FALSE);
include('global.php');

if(isset($_POST['username']))
{
        if(isset($_POST['password']))
        {
                $username = $core->EscapeString($_POST['username']);
                $password = md5($_POST['password']);
                $userq = mysql_query("SELECT * FROM users WHERE username ='".$username."'");
                if(mysql_num_rows($userq) > 0)
                {
                if($users->CheckBan($username))
                {
                header($users->BanInfo($username));
                die;
                }
                        $userq = mysql_query("SELECT * FROM users WHERE username ='".$username."'");
                        $user = mysql_fetch_array($userq);
                        if($password == strtolower($user['password']))
                        {
                                $user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE username ='".$username."'"));
                                $_SESSION['username'] = $users->UserInfo($username, 'username');
                                $_SESSION['account'] = $user['mail'];
                                $query = mysql_query("UPDATE users SET last_online = UNIX_TIMESTAMP(), ip_last = '".$_SERVER['REMOTE_ADDR']."' WHERE username = '".$username."'");
                                header("Location: ./me.php");
                        }
                        else
                        header("Location: ./index.php?error=password");
                }
                else
                {
                        $userq = mysql_query("SELECT * FROM users WHERE mail ='".$username."'");
                        if(mysql_num_rows($userq) > 0)
                        {
                                $user = mysql_fetch_array($userq);
                                if($password == strtolower($user['password']))
                                {
                                        $_SESSION['account'] = $username;
                                        header("Location: ./characters.php");
                                }
                                else
                                header("Location: ./index.php?error=password");
                        }
                        else
                        header("Location: ./index.php?error=username");
                }
        }
        else
        header("Location: ./index.php?error=password");
}
else
header("Location: ./index.php?error=username");
?>

lembrando a página characters, funciona perfeitamente

A pagina me.php não carrega a sessão.

em outro servidor os arquivos .php funcionavam perfeitamente, troquei para hostgator deu isso :S

Edited by Yuri Vidal
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...