PHP:
Código PHP:
Ver original<?php
//Codigo
$sql = "SELECT * FROM usuario WHERE email = '".$_POST['forml_email']."' ";
$email = $row ['email'];
$contrasena = $row ['contrasena'];
$nombre = $row ['nombre'];
$admin = $row ['admin'];
if ($email == $_POST['forml_email'] && $contrasena == $_POST['forml_contrasena']){
$_SESSION['email'] = $email;
$_SESSION['nombre'] = $nombre;
$_SESSION['admin'] = $admin;
if ($admin == 'si'){
header("location:panels/panel_admin.php"); }
header("location:panels/panel_control.php");
}else {
$mensaje .= 'Error en el usuario o contraseña';
}
}
}
?>
HTML:
Código HTML:
Ver original<form action="" method="POST">
<label class="col-lg-4 control-label">Correo Electronico
</label> <input type="email" name="forml_email" reqired />
<label class="col-lg-4 control-label"> Contraseña
</label> <input type="password" name="forml_contrasena" required />