-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathControladorRestablecerPass.php
More file actions
32 lines (26 loc) · 939 Bytes
/
Copy pathControladorRestablecerPass.php
File metadata and controls
32 lines (26 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
include("ConexionBDD.php");
if(isset($_POST['btnRestablecer'])){
if(strlen($_POST['departamento']) >= 1 && strlen($_POST['pass']) >= 1){
$departamento = $_POST['departamento'];
$pass = $_POST['pass'];
$consulta = "UPDATE `inquilino` SET `pass`='$pass' WHERE departamento = '$departamento'";
$resultado = mysqli_query($conexion,$consulta);
if($resultado){
header('Location: index.php');
}else{
?>
<script>
alert("¡Error! No se pudo modificar el registro");
</script>
<?php
}
}else {
?>
<script>
alert("Debe llenar todos los campos requeridos");
</script>
<?php
}
}
?>