Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
Kraswerlo

Ajuda erro no login

Question

Olá não sei se estou na área certa mais se não tiver algum administrador mova por favor.

Então eu estou fazendo um painel de administração entanto não loga.Ele mostra o id em senha na url não sei porque .Não esta indo para página dps de logar fica no login.alguém poderia mendar uma ajuda?

<?
ob_start('ob_gzhandler');
session_start();
header('p3p: CP="CAO PSA OUR"');

include_once "incluir/configura.php";
include_once "injection.php";


//Segurança para o PHP
function escapestrings($string)
{
    //se magic_quotes não estiver ativado, escapa a string
    if (!get_magic_quotes_gpc())
    {
        return mysql_escape_string($string); // função nativa do php para escapar variáveis.
    }
    else
    {
        // caso contrario
        return $string; // retorna a variável sem necessidade de escapar duas vezes
    }
}



if(!session_is_registered("gmf***es"))
{
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<title>Painel de Administração</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->	
	<link rel="icon" type="image/png" href="images/icons/favicon.ico"/>
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/bootstrap/css/bootstrap.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="fonts/font-awesome-4.7.0/css/font-awesome.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="fonts/Linearicons-Free-v1.0.0/icon-font.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/animate/animate.css">
<!--===============================================================================================-->	
	<link rel="stylesheet" type="text/css" href="vendor/css-hamburgers/hamburgers.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<!--===============================================================================================-->
	<link rel="stylesheet" type="text/css" href="css/util.css">
	<link rel="stylesheet" type="text/css" href="css/main.css">
<!--===============================================================================================-->

<script language="JavaScript" type="text/JavaScript">
<!--
function disabledBttn(formname)
{
    if (document.all || document.getElementById) {
        for (i=0;i<formname.length;i++) {
            var bttn=formname.elements[i];
            if(bttn.type.toLowerCase()=="submit" || bttn.type.toLowerCase()=="reset" || bttn.type.toLowerCase()=="button")
                bttn.disabled=true;
        }
    }
}
//-->
</script>


</head>
<body>
	
<?
    if($_POST['acao']!="Logar")
    {
?>	
	
	<div class="limiter">
		<div class="container-login100" >
			<div class="wrap-login100 p-t-190 p-b-30">
				<form class="login100-form validate-form">
					<div class="login100-form-avatar">
						<img src="images/avatar-01.jpg" alt="AVATAR">
					</div>

					<span class="login100-form-title p-t-20 p-b-45">
						Admin
					</span>

					<div class="wrap-input100 validate-input m-b-10" data-validate = "Username is required">
						<input class="input100" type="text" name="username" placeholder="Username">
						<span class="focus-input100"></span>
						<span class="symbol-input100">
							<i class="fa fa-user"></i>
						</span>
					</div>

					<div class="wrap-input100 validate-input m-b-10" data-validate = "Password is required">
						<input class="input100" type="password" name="password" placeholder="Password">
						<span class="focus-input100"></span>
						<span class="symbol-input100">
							<i class="fa fa-lock"></i>
						</span>
					</div>

					<div class="container-login100-form-btn p-t-10">
						<button class="login100-form-btn">
							Logar
						</button>
					</div>

				</form>
			</div>
		</div>
	</div>
	
	

	
<!--===============================================================================================-->	
	<script src="vendor/jquery/jquery-3.2.1.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/bootstrap/js/popper.js"></script>
	<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
<!--===============================================================================================-->
	<script src="vendor/select2/select2.min.js"></script>
<!--===============================================================================================-->
	<script src="js/main.js"></script>

<?
    }
    else
    {
        $required=array(
            "IDADM"=>$_POST[username],
            "PWADM"=>$_POST[password],
        );

//Obtendo login e senha
$gmAPT =$_POST['username'];
$gmpassAPT = $_POST['password'];
$gmAPT = trim($gmAPT);
$gmpassAPT = trim($gmpassAPT);


if (anti_sql($gmAPT) != 0 || anti_sql($gmpassAPT) != 0) {
echo "<meta HTTP-EQUIV='Refresh' CONTENT='0;URL=index.php'>";
} else {


        for($i=0;$i<count($required);$i++)
        {
            list($key,$value)=each($required);

            if(!$value)
                echo "<b>$key</b> is required<br>";
            else
                $chkArr[]=true;
        }

        if(count($chkArr)==count($required))
        {

            $connection = odbc_connect( $connection_string, $user, $pass );


            $gmAPT=$_POST[username];
            $query = "SELECT * FROM [ADM].[dbo].[loginGM] WHERE [idGM]='$gmAPT' AND [passGM]='$gmpassAPT'";
            $q = odbc_exec($connection, $query);

            $qt = odbc_do($connection, $query);
            $i = 0;
            while(odbc_fetch_row($qt)) $i++;

            if($i>0)
            {
                session_register("gmf***es");
                $farr = odbc_fetch_array($q);

                $_SESSION["IDADM"]=$farr[idGM];
				$_SESSION["NICKGM"]=$farr[nickGM];
				$_SESSION["permissao"]=$farr[permissao];



       echo "<table width=440 border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td height=100 align=center><b><font color=#008000>DADOS DE ACESSO CORRETOS! <br> REDIRECIONANDO PARA O PAINEL</font></b></td>
  </tr>
</table>";
            }
            else
       echo "<table width=440 border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td height=100 align=center><b><font color=#FF0000>LOGIN OU SENHA INCORRETO!</font></b></td>
  </tr>
</table>";

        }

        echo "<meta HTTP-EQUIV='Refresh' CONTENT='2;URL=index2.php'>";


    }
   }

?> 
 
</body>
</html>


<?
exit;
}
include_once "index2.php";
ob_end_flush();
?>

 

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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.

Sign in to follow this  



  • Forum Statistics

    • Total Topics
      148402
    • Total Posts
      643804
×
×
  • Create New...