[Ajuda] PHP
#1

Bom, nгo consigo fazer um sistema para checar se a conta do jogar tem level de administrador maior que 1 para poder logar no painel. Alguйm pode me ajudar com isso? nгo sei nem por onde comeзar.. sou iniciante em PHP.

PHP код:
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from www.soluslabs.com/clients/clientarea.php by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 09 Jan 2015 20:06:28 GMT -->
<!-- Added by HTTrack -->
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<!-- /Added by HTTrack -->
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>GTA:Adrenaline ~ Top Levels</title>
    <base />
    <script type="text/javascript" src="includes/jscript/jquery.js"></script>
    <link href="templates/solusvm-onapp/css/bootstrap.css" rel="stylesheet">
    <link href="templates/solusvm-onapp/css/whmcs.css" rel="stylesheet">
    <script src="templates/solusvm-onapp/js/whmcs.js"></script>
</head>
<body>
    <div style="margin-top:20px"></div>
    <div class="logo"><img src="images/logo.png" width="320" height="130" />
    </div>
    <br />
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="nav-collapse">
                    <ul class="nav">
              <li>
                <a id="pagina-inicial" href="index.php">Inicio</a>
              </li>
            </ul>
            <ul class="nav">
              <li>
                <a id="pagina-login" href="login.php">Entrar</a>
              </li>
            </ul>
                </div>
                <!-- /.nav-collapse -->
            </div>
        </div>
        <!-- /navbar-inner -->
    </div>
    <!-- /navbar -->
    <div class="whmcscontainer">
        <div class="contentpadded">
            <div class="page-header">
                <div class="styled_title">
                    <h2>Login</h2>
                    </form>
                    <script type="text/javascript">
                        $("#username").focus();
                    </script>
                </div>
            </div>
    <?php
    
include('config.php');
    
session_start();
    if(isset(
$_POST['login']))
    {
        
$nome mysql_real_escape_string($_POST['nome']);
        
        
$query mysql_query("SELECT * FROM contas WHERE Username = '$nome'"$conectar) or die(mysql_error());
        
$rows mysql_num_rows($query);
        if(
$rows)
        {
            
$senha mysql_real_escape_string($_POST['senha']);
            
$query mysql_query("SELECT * FROM contas WHERE Username = '$nome' AND Password = '$senha'"$conectar) or die(mysql_error());
            
$rows mysql_num_rows($query);
            if(
$rows)
            {
                
$dados mysql_fetch_assoc($query);
                
$nome $dados['name'];
                
                
$_SESSION['username'] = $nome;
                
header('location: mysql.php');
            }
            else echo 
"Senha incorreta.<br>";
        }
        else
        {
            echo 
"Nao ha nenhum usuario registrado com este nome.<br>";
        }
    }
    
?>
<form method = "post" action = "">
    Nick:<br><input type = "text" name = "nome"><br>
    Senha:<br><input type = "password" name = "senha"><br><br>
    <input type = "submit" name = "login" value = "Login">
</form>
        </div>
        <div class="footerdivider">
            <div class="fill"></div>
        </div>
        <div class="whmcscontainer">
            <div class="footer">
                <div id="copyright">Copyright &copy; 2015 GTA:Adrenaline. Todos os direitos reservados.</div>
                <div class="clear"></div>
            </div>
        </div>
</body>
<!-- Mirrored from www.soluslabs.com/clients/clientarea.php by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 09 Jan 2015 20:06:39 GMT -->
</html>
Reply


Messages In This Thread
PHP - by s4kuL - 12.02.2015, 23:24
Re: PHP - by smiir - 12.02.2015, 23:46
Re: PHP - by Dolby - 12.02.2015, 23:46
Re: PHP - by Gii - 12.02.2015, 23:52

Forum Jump:


Users browsing this thread: 2 Guest(s)