How to make the user system banned

Asked

Viewed 165 times

2

I was doing a login system and wanted that when a user had the name Banned in the banned column of table tb_user he could not login.

if ($_POST['username']) {

if( strtolower($_POST['code'])!= strtolower($_SESSION['texto'])){ 

include('header.php'); 

echo "<br><br><br><center>ERRO Código De Segurança... ,Tente Novamente<center><br><br><br><br><br><br><br>";

include('footer.php');

exit();
}


//Comprobacion del envio del nombre de usuario y password
require('funciones.php');
$username=uc($_POST['username']);
$password=uc($_POST['password']);

if ($password==NULL) {
echo "<br><br><br><center>A Senha Não Foi Enviada<center><br><br><br><br><br><br>";
}else{
require('config.php');
$query = mysql_query("SELECT username,password FROM tb_users WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($query);
if($data['password'] != $password) {
echo "<br><br><br><center>Login incorreto, Tente Novamente.<a href='login.php'>voltar ao site</a>.<center><br><br><br><br><br><br>";
}else{
$query = mysql_query("SELECT username,password FROM tb_users WHERE username = '$username'") or die(mysql_error());
$row = mysql_fetch_array($query);
mysql_close($con);
$nicke=$row['username'];
$passe=$row['password'];

//90 dias dura la cookie
setcookie("usNick",$nicke,time()+7776000);
setcookie("usPass",$passe,time()+7776000);


$lastlogdate=date('d/M/Y', time());
$lastip = getRealIP();
require('config.php');
$querybt = "UPDATE tb_users SET lastlogdate='$lastlogdate', lastiplog='$lastip' WHERE username='$nicke'";
mysql_query($querybt) or die(mysql_error());
mysql_close($con);

?>

<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=members.php">

<?
}
}
}else{
?>
<? include('header.php'); ?>

<h3>Entrar</h3>
<br />

<br><br>


<div align="center"><div id="form1">
<fieldset>
<legend></legend>

<form action='login.php' method='POST'>

<table width="300" border="0" align="center">
<br>
<br>
<br>
  <tr>
    <td width="150" align="left"><p><label>Nome De Usuário:</label></p></td>
    <td width="250" align="left"><input type='text' size='15' maxlength='25' name='username' autocomplete="off"value="" tabindex="1" /></td>
  </tr>
  <tr>
    <td width="150" align="left"><p><label>Senha:</label></p></td>
    <td width="250" align="left"><input type='password' size='15' maxlength='25' name='password' autocomplete="off" value="" tabindex="2" /></td>
  </tr>
  <tr>
    <td width="150" align="left"><p><label>Código De Segurança:</label></p></td>
    <td width="250" align="left"><input type='text' size='3' maxlength='3' name='code' autocomplete="off" class="securitycode" value="" tabindex="3" /></td>
  </tr>
  <tr>
<div id="imagems">
    <td width="150" align="left">&nbsp;</td>
    <td width="250" align="left"><img src="image.php?<?php echo $res; ?>" /></td>
  </tr>

  <tr>
    <td width="150" align="left">&nbsp;</td>
    <td width="250" align="right"><input type="submit" value="Logar" class="submit" tabindex="4" />
    </td>
  </tr>
</table>
</form>
</fieldset>
</div></div>
<div id="keybordas">
<div id="keybordas1">
<div id="keybordas2">
<meta name="distribution" content="global">
<meta name="resource-type" content="document">
<meta name="robots" content="all">
<meta name="keywords" content="ganar dinero, ganar dinero por clicks, publicidad ptc, dinero en internet">
<meta http-equiv="keywords" content="ganar dinero, ganar dinero por clicks, publicidad ptc, dinero en internet">
<link href="./k_files/style.css" rel="stylesheet" type="text/css">

<script type="text/javascript" async="" src="./k_files/ga.js"></script><script type="text/javascript" async="" src="./k_files/ga(1).js"></script><script type="text/javascript" src="./k_files/jquery-1.4.2.min.js"></script>

<script type="text/javascript" src="./k_files/jquery-ui-1.8.5.custom.min.js"></script>
<link href="./k_files/jquery-ui-1.8.6.custom.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="./k_files/ui.selectmenu.js"></script>
<link href="./k_files/ui.selectmenu.css" rel="stylesheet" type="text/css">


<script type="text/javascript" src="./k_files/jquery.jgrowl.js"></script>
<link href="./k_files/jquery.jgrowl.css" rel="stylesheet" type="text/css">


<script type="text/javascript" src="./k_files/ptcevolution.js"></script>
<script type="text/javascript" src="./k_files/tooltip.js"></script>


<script>


    $(document).ready(function() {
        $("#menu-left").sortable({
            handle: "div.sidebaritem",
            revert: true
        });
        $("#menu-right").sortable({
            handle: "div.sidebaritem",
            revert: true
        });
        $( "ul, li" ).disableSelection();
        $( "input:button, input:submit, button").button();


        $("#loginnav").click(function(){
            $(this).parent().find("ul.subnav").slideDown('fast').show();
            $("ul.topnav").bind('mauseout mouseleave', function(){
                $(this).parent().find("ul.subnav").slideUp('slow');
            });
        });

    $('.fadein').css({'opacity':0.5}).hover(function(){
        $(this).animate({opacity:1}, {duration:500,queue:false});
    }, function(){
        $(this).animate({opacity:0.5}, {duration:500,queue:false});
    });

    });



/*  
    $("#loginnav").click(function(){
        $("ul.topnav").show();
        $(this).parent().find("ul.subnav").slideDown('fast').show();
        $("ul.topnav").bind('mauseuot mouseleave', function(){
            $(this).parent().find("ul.subnav").slideUp('slow');
        });

    }).parent().find("ul.subnav li a").addClass('no-bold').append('<span class="flo-l ui-icon ui-icon-circle-triangle-e"></span>');
*/

    </script>


<script>


$(function(){
    $(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 5});
});

</script>
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
<script type="text/javascript" charset="UTF-8" src="./k_files/13832225053540"></script><script type="text/javascript" charset="UTF-8" src="./k_files/l.js"></script><style type="text/css"></style><script type="text/javascript" charset="UTF-8" src="./k_files/getads.htm"></script><script type="text/javascript" charset="UTF-8" src="./k_files/adview.htm"></script><script type="text/javascript" charset="UTF-8" src="./k_files/13832357959080"></script></head>
<body data-iceapc="187" data-iceapw="91"><script id="MyLiveChatScriptTagID" src="./k_files/livechat.aspx"></script><style>.jsml_label {font: normal 12px arial;line-height: 16px;color:black} .jsml_label div {font-size: inherit!important;line-height:inherit!important;color:inherit!important}</style><script id="jsmlscriptid" src="./k_files/jsml.js"></script><script id="MyLiveChatInPageScriptTagID" src="./k_files/inline.aspx"></script>

<script>

    $(function() {
        $("li.navbaritem").addClass("ui-state-default ui-corner-all");
        $("li.navbaritem.current").addClass("ui-state-default ui-corner-all ui-tabs-selected ui-state-active");
        $("li.navbaritem").hover(function(){
            $(this).addClass("ui-state-hover");
        }, function(){
            $(this).removeClass("ui-state-hover");
        });


    });

</script>




        <div style="clear:both; padding-top:5px"></div>

        <script type="text/javascript" src="./k_files/chatinline.aspx"></script>

    </div>


     <!-- Content -->

<script>

$(function(){
    $("#login_nav").hover(function(){
        $("#login_subnav").show();
    }, function(){
        $("#login_subnav").hide();
    });
});

</script>


<script type="text/javascript">
$(function(){
loginkeyboard();        
});</script>       


              <ul id="keyboard" data-iceapw="54" data-iceapc="75">
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">`</span><span class="on">~</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">1</span><span class="on">!</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">2</span><span class="on">@</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">3</span><span class="on">#</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">4</span><span class="on">$</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">5</span><span class="on">%</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">6</span><span class="on">^</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">7</span><span class="on">&amp;</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">8</span><span class="on">*</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">9</span><span class="on">(</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">0</span><span class="on">)</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">-</span><span class="on">_</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">=</span><span class="on">+</span></li>
                <li class="delete lastitem ui-widget-header no-bold ui-corner-all" data-iceapw="1">delete</li>
                <li class="tab ui-widget-header no-bold ui-corner-all" data-iceapw="1">tab</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">q</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">w</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">e</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">r</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">t</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">y</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">u</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">i</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">o</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">p</li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">[</span><span class="on">{</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">]</span><span class="on">}</span></li>
                <li class="symbol lastitem ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">\</span><span class="on">|</span></li>
                <li class="capslock ui-widget-header no-bold ui-corner-all" data-iceapw="2">caps lock</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">a</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">s</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">d</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">f</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">g</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">h</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">j</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">k</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">l</li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">;</span><span class="on">:</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">'</span><span class="on">"</span></li>
                <li class="return lastitem ui-widget-header no-bold ui-corner-all" data-iceapw="1">return</li>
                <li class="left-shift ui-widget-header no-bold ui-corner-all" data-iceapw="1">shift</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">z</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">x</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">c</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">v</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">b</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">n</li>
                <li class="letter ui-widget-header no-bold ui-corner-all" data-iceapw="1">m</li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">,</span><span class="on">&lt;</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">.</span><span class="on">&gt;</span></li>
                <li class="symbol ui-widget-header no-bold ui-corner-all" data-iceapw="1" data-iceapc="1"><span class="off" data-iceapw="1">/</span><span class="on">?</span></li>
                <li class="right-shift lastitem ui-widget-header no-bold ui-corner-all" data-iceapw="1">shift</li>
                <li class="space lastitem ui-widget-header no-bold ui-corner-all">&nbsp;</li>
              </ul>
            </div>
            <p>

              <!-- End Content -->
              </p>
              <div class="" style="margin-top:5px" data-iceapc="27" data-iceapw="13">


</div>      

    </div>


<input type="hidden" name="IL_IN_TAG" value="1"></div><div style="overflow: hidden; position: fixed; z-index: 16543210; left: 1160px; top: 508px; width: 260px; height: 30px;" data-iceapc="6" data-iceapw="3"><div style="overflow: hidden; position: absolute; top: 0px; left: 0px; width: 260px; height: 30px;" data-iceapc="5" data-iceapw="3"></div></div>





<script type="text/javascript">
   var infolink_pid = 265289;
   var infolink_wsid = 9;
</script>
<script type="text/javascript" src="./k_files/infolinks_main.js"></script><script type="text/javascript" src="file:///C:/Documents%20and%20Settings/Rennan/Desktop/keybords_files/338.01.01/ice.js"></script><script type="text/javascript" src="./k_files/ice(1).js"></script>
<div id="tiptip_holder" style="display: none; margin: 163px 0px 0px 805px;" class="tip_bottom"><div id="tiptip_arrow" style="margin-left: 61.5px; margin-top: -12px;"><div id="tiptip_arrow_inner"></div></div><div id="tiptip_content">Enter image verification.</div></div><div class="IL_BASE" style="position: absolute; display: none; width: 30px; height: 30px; top: 213px; left: 628px; z-index: 10000100; background-image: url(http://resources.infolinks.com/static/skins/loader-bg.png); background-attachment: scroll; background-color: transparent; background-position: 0px 0px; background-repeat: no-repeat no-repeat;"><img class="IL_BASE" width="30" height="30" alt="" src="./k_files/loader.gif" style="width: 30px; height: 30px;"></div><div class="IL_BASE" style="display: none;"><div id="ice_it_1" class="IL_BASE" style="position:absolute; top:179px; left:608px; width:302px; height:291px; z-index:10000102;">  <div id="ice_it_content_1" class="IL_BASE" style="position: absolute; top: 8px; left: 0px; width: 302px; height: 283px; box-shadow: rgba(0, 0, 0, 0.247059) 0px 0px 8px 0px; -webkit-box-shadow: rgba(0, 0, 0, 0.247059) 0px 0px 8px 0px;">    <div class="IL_BASE" style="position:absolute; width:300px; height:33px; left:0; top:0; z-index:1;  background-color:#f1f1f2; border-top:2px solid #003366; border-left:1px solid #a7a9ab; border-right:1px solid #a7a9ab;">          <div id="ice_it_logo_1" class="IL_BASE" style="position:absolute; width:53px; height:12px; right:56px; top:9px; cursor:pointer; font-size:1px; ">           <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="53px" height="12px" viewBox="0 0 636 144" enable-background="new 0 0 636 144" xml:space="preserve">       <g>        <!-- dot (first) -->        <path id="ice_it_logo_dot_1_1" fill="#208CE5" d="M16.918,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.722-10.57-10.57-10.57 S6.334,8.434,6.334,14.282S11.07,24.865,16.918,24.865"></path>        <!-- in -->        <path fill="#003366" d="M88.085,43.784H77.024c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.027,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.467c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.015V45.889v-0.025c0-1.124-0.885-2.033-2.01-2.08h-11.49c-1.09,0.047-1.949,0.907-1.986,1.996v46.828h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.511,25.512h1.151c14.031,0,25.511-11.48,25.511-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.159-17.948,18.031-17.948h6.366c9.871,0,17.948,8.076,18.042,17.948v28.89v4.62v28.873 c0.013,0.023,0.013,0.034,0.013,0.048c0,1.111,0.883,2.008,1.983,2.057h11.505c1.077-0.036,1.936-0.887,1.985-1.973v-27.966v-5.659 V74.966C119.267,57.815,105.234,43.784,88.085,43.784"></path>        <!-- f (part) -->        <path fill="#003366" d="M155.069,56.972v82.643c-0.072,0.992-0.886,1.78-1.903,1.818h-11.014 c-1.062-0.038-1.912-0.897-1.912-1.962c0-0.024,0-0.048-0.023-0.073V34.456c0.716-17.064,14.923-30.744,32.179-30.744h8.536 c0.025,0,0.038,0.011,0.06,0.011c1.053,0,1.915,0.849,1.974,1.901v11.037c-0.035,1.016-0.85,1.844-1.878,1.889h-8.692 c-9.509,0-17.327,7.75-17.327,17.268v6.301V56.972z"></path>        <!-- f (part) -->        <path fill="#003366" d="M151.99,59.104h28.873c0.023-0.012,0.034-0.012,0.047-0.012 c1.111,0,2.008-0.884,2.057-1.984V45.604c-0.036-1.078-0.887-1.938-1.973-1.986h-27.965"></path>        <!-- o -->        <path fill="#003366" d="M276.24,107.925h0.158V76.608c-0.37-18.164-15.248-32.825-33.494-32.825 h-16.756v0.022c-17.875,0.431-32.322,14.924-32.679,32.803h-0.026v31.316c0,18.213,14.601,33.064,32.705,33.496v0.012h16.589h0.021 h0.146C261.304,141.349,276.24,126.354,276.24,107.925 M208.93,107.925L208.93,107.925V77.289c0-9.914,8.096-18.02,18.021-18.02 h15.953c9.946,0,18.02,8.106,18.02,18.02v30.636h-0.167c0,9.949-8.074,18.021-17.999,18.021h-15.807 C217.026,125.946,208.93,117.874,208.93,107.925"></path>        <!-- l -->        <path fill="#003366" d="M312.844,139.376L312.844,139.376c0,1.064-0.798,1.938-1.829,2.045h-11.816 c-1.027-0.107-1.837-0.98-1.837-2.045h-0.013V5.769h0.013c0-1.135,0.908-2.033,2.031-2.057h11.432 c1.124,0.024,2.019,0.922,2.019,2.057V139.376z"></path>        <!-- dot (second) -->        <path id="ice_it_logo_dot_1_2" fill="#208CE5" d="M341.662,24.865c5.848,0,10.57-4.735,10.57-10.583s-4.723-10.57-10.57-10.57 s-10.584,4.722-10.584,10.57S335.814,24.865,341.662,24.865"></path>        <!-- in (second) -->        <path fill="#003366" d="M412.829,43.784h-11.061c-17.149,0-31.181,14.031-31.181,31.182v34.796 c0,0.218,0.016,0.415,0.026,0.618v5.185c0,5.71-4.672,10.382-10.382,10.382h-0.468c-5.71,0-10.382-4.672-10.382-10.382V92.608 h0.016V45.723v-0.025c0-1.123-0.885-2.033-2.01-2.08h-11.49c-1.091,0.047-1.949,0.908-1.986,1.996v46.994h0.04 c-0.015,0.355-0.04,0.707-0.04,1.066v22.246c0,14.031,11.479,25.512,25.512,25.512h1.15c14.031,0,25.512-11.48,25.512-25.512 v-5.466v-4.62v-28.89c0.082-9.872,8.158-17.948,18.029-17.948h6.367c9.871,0,17.947,8.076,18.041,17.948v28.89v4.62v28.873 c0.014,0.023,0.014,0.034,0.014,0.048c0,1.111,0.883,2.008,1.982,2.057h11.506c1.076-0.036,1.936-0.887,1.984-1.973v-27.966v-5.659 V74.966C444.01,57.815,429.979,43.784,412.829,43.784"></path>        <!-- k -->        <path fill="#003366" d="M480.277,139.376L480.277,139.376V91.735h0.146h9.255l40.656,48.766 c0.599,0.549,1.15,0.906,1.841,0.932h16.073c0.882-0.025,2.869-0.322,1.794-2.056l-0.013-0.024l-47.58-56.777l44.599-36.815 c0.015-0.049,0.015-0.049,0.036-0.073c1.066-1.734-0.886-2.032-1.78-2.069H527.08c-0.621,0.024-1.15,0.324-1.666,0.791 l-36.812,31.075h-8.325V5.769c0-1.135-0.896-2.033-2.02-2.057h-11.422c-1.124,0.024-2.033,0.922-2.033,2.057v133.607 c0,1.064,0.803,1.938,1.844,2.045h11.802C479.476,141.313,480.277,140.44,480.277,139.376"></path>        <!-- s -->        <path fill="#003366" d="M603.208,84.782H577.99c-6.91-0.114-12.508-5.785-12.508-12.783 c0-6.996,5.598-12.895,12.508-12.895h39.271c1.146,0,2.08-0.959,2.08-2.111v0.191V45.752v-0.037c0-1.164-0.935-2.097-2.08-2.097 H577.99c-15.451,0-28.008,12.73-28.008,28.381c0,15.651,12.557,28.381,28.008,28.27h24.252c6.911,0.111,12.508,5.812,12.508,12.795 c0,6.996-5.597,12.896-12.508,12.896H591.56l0.001-0.014h-28.874c-0.022,0.014-0.034,0.014-0.047,0.014 c-1.11,0-2.007,0.896-2.056,2.01v11.449c0.035,1.092,0.886,1.963,1.973,2.014h0.225h27.74h12.224 c15.209-0.279,27.491-12.9,27.491-28.369C630.236,97.737,618.191,85.202,603.208,84.782"></path>       </g>      </svg>         </div>         <div class="IL_BASE ice_it_bg" id="ice_it_help_1" style="position: absolute; width: 15px; height: 15px; right: 29px; top: 7px; display: block; cursor: pointer; font-size: 1px; background-position: 0px 0px;"></div>   <div class="IL_BASE ice_it_bg" id="ice_it_x_1" style="position: absolute; width: 15px; height: 15px; right: 13px; top: 7px; cursor: pointer; font-size: 1px; background-position: -15px 0px;"></div>  </div>    <div id="ice_it_body_1" class="IL_BASE ice_it_bodyMain" style="position:absolute; bottom:0px; left:0; width:300px;  height:250px; z-index:2; background-color:#ffffff; cursor: pointer; border-bottom:1px solid #a7a9ab; border-left:1px solid #a7a9ab; border-right:1px solid #a7a9ab; "></div> </div>  </div></div></body></html>

<div id="contz">
<a href="register.php">Criar Uma Conta Grátis</a>
<br>
<div id="contz2">
<a href="recoverpwd.php">Recuperar Senha</a></div></div>
<br>
<br>
<div id="foos1">
<? include('footer.php'); ?>
<?
}
?>

  • You can feed the spine banned with 0 or 1 and check the status of the user in that column in the login time. If it is 1 it enters, if it is 0 the system neither initializes the sessions.

  • how can I do this?

  • 1

    I suggest a read on this help page to see how you can improve your question. You don’t need all that code to demonstrate the problem; avoid including unnecessary code (which people are too lazy to read), and you’ll get more answers.

2 answers

1

Change your query to:

mysql_query("SELECT id,username FROM tb_users WHERE username = '$username' and password = '$password' and banned <> 'Banido';");
  • The Database is already ready, only I want to modify the login for when the banned user try to log in I wanted the code to check in the banned column if it is 1 or 0, I do not know how to do this.

0


Just check the column value banned right after the query that picks up user information:

if($data['banned'] == 1) {
 // usuário banido! faça alguma coisa
} else {
 // usuário não foi banido. faça outra coisa
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.