How can I block a user after 3 attempts? I am doing a username and password login. They ask me that if a user made 3 failed attempts to log in, the account should be blocked, according to the JavaScript function I would have to block the user after 3 failed attempts, but the loop only stays in "You have 2 attempts left" and although I make a mistake again, it just stays at "You have 2 attempts left".
I am trying to login with php and msql and when entering an unregistered user it shows me this
Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\Store\admin_control\login\validar.php on line 18
Warning: Trying to access array offset on value of type null in C:\xa[![enter image description here][1]][1]mpp\htdocs\Shop\admin_control\login\validar.php on line 22
<?php
$usuario=$_POST['usuario'];
$clave=$_POST['clave'];
session_start();
$_SESSION['usuario']=$usuario;
include('db.php');
$consulta="SELECT*FROM usuarios WHERE usuario='$usuario' and clave='$clave'";
$resultado=mysqli_query($conexion,$consulta);
$filas=mysqli_fetch_array($resultado);
if($filas['id_cargo'] == 1) { //ADMINSTRADOR
header("location:../../admin/productos.php");
}else if($filas['id_cargo'] == 2){ // CLIENTE
header("location:../../index.php");
}
else{
?>
<?php
include("index.php");
?>
<h1 class="bad">No existe ningun usuario con esas creedenciales <a href="#">¿Deseas crear una cuenta?</a> </h1>
<?php
}
mysqli_free_result($resultado);
mysqli_close($conexion);
I'm trying to find a way to document my functions a bit, i.e. I use VS Code and when you use a native Python function (and have the Python package installed) and hover over the function, a small window appears explaining briefly what the functions do and describe the parameters a little, I would like to be able to achieve the same effects with functions that I can create (if possible).
The format doesn't really matter to me, in some editors I see that the same window is shown with a different format, they even put a box and so on. I don't really care much about the format, although if I could also modify the format it would be excellent, I just need to be able to document the functions, if someone could help me I would be very grateful.
I have a problem with performing this action:
I am looking for the click to be made after performing a series of steps automatically, that is, to simulate the click that the user should make.
What I have tried is the following, but it doesn't work for me:
<mat-tab-group>
<mat-tab id="listaODs" label="Lista de Órdenes">
<div class="row">
<div class="col-md-12">
<mat-table class="mat-table__wrapper" [dataSource]="listOrdenesDespacho"
#MatSort="matSort" matSort perfectScrollbar>
<!-- ... -->
const input = document.getElementById("listaODs") as HTMLInputElement | null
input.click()
I have an index view, from which I have 3 buttons that should open three different modals, but it only opens one, if I delete two and leave only one (any of the three buttons) it does open and they work, but if I put them together they don't open all three only one, does anyone know why? I've been trying to know the causes of the error for days but I can't, here I show the code:
<td>
<a href="" data-target="#modal-uno-{{$cat->id}}" data-toggle="modal"><button class="btn btn-info">UNO</button></a>
<a href="" data-target="#modal-dos-{{$cat->id}}" data-toggle="modal"><button class="btn btn-success">DOS</button></a>
<a href="" data-target="#modal-delete-{{$cat->id}}" data-toggle="modal"><button class="btn btn-danger">Eliminar</button></a>
</td>
@include('FOLDER1.FOLDER2.uno')
@include('FOLDER1.FOLDER2.dos')
@include('FOLDER1.FOLDER2.modal')
pass modal code
<div class="modal fade modal-right" aria-hidden="true" role="dialog" tabindex="-1" id="modal-dos-{{$cat->id}}">
{{Form::Open(array('action'=>array('CategoryController@uno',$cat->id),'method'=>'uno'))}}
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4 class="modal-title">Editar</h4>
</div>
<label for="producto">Camion</label>
<input type="text" name="porducto" class="form-control" placeholder="" value="{{$producto}}"></input readonly>
<div class="form-group">
<div class="modal-body">
<p>Confirme si desea editar </p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
<button type="submit" class="btn btn-primary">Confirmar</button>
</div>
</div>
</div>
</div>
{{Form::Close()}}
</div>