-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck.php
More file actions
43 lines (29 loc) · 1.03 KB
/
check.php
File metadata and controls
43 lines (29 loc) · 1.03 KB
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
33
34
35
36
37
38
39
40
41
42
43
<?php
session_start();
include "./conexion.php";
if( isset($_POST['email']) && isset($_POST['password']) ){
$resultado = $conexion->query("select * from usuario where
email='".$_POST['email']."' and
password='".sha1($_POST['password'])."' limit 1")or die($conexion->error);
if(mysqli_num_rows($resultado)>0){
$datos_usuario = mysqli_fetch_row($resultado);
$nombre = $datos_usuario[1];
$id_usuario = $datos_usuario[0];
$email = $datos_usuario[3];
$imagen_perfil = $datos_usuario[5];
$nivel = $datos_usuario[6];
$_SESSION['datos_login']= array(
'nombre'=>$nombre,
'id_usuario'=>$id_usuario,
'email'=>$email,
'imagen'=>$imagen_perfil,
'nivel'=>$nivel
);
header("Location: ../admin/");
}else{
header("Location: ../login2.php?error=Credenciales incorrectas");
}
}else{
header("../login2.php");
}
?>