Fatal error: Uncaught Error: Call to undefined function execute() in D:\xampp\htdocs\LOGIN\validar.php:14 Stack trace: #0 {main} thrown in D:\xampp\htdocs\LOGIN\validar.php on line 14
Fatal error: Uncaught Error: Call to undefined function execute() in D:\xampp\htdocs\LOGIN\validar.php:14 Stack trace: #0 {main} thrown in D:\xampp\htdocs\LOGIN\validar.php on line 14
Este es mi codigocódigo
<?php session_start();
if(isset($_SESSION['usuario'])){
header('Location: ../administrador/administrador.php');
}
if($_SERVER['REQUEST_METHOD']=='POST'){
$usuario = $_POST["documento"];
$contrasena = $_POST["contrasena"];
require('conexion.php');
$consulta = $conexion ->prepare('SELECT * FROM clientes WHERE documento=:usuario and contrasena=:contrasena');
$consulta = execute(array(':usuario'=>$usuario,':contrasena'=>$contrasena));
$resultado = $consulta ->fecth();
if($resultado!==false){
$_SESSION['usuario']=$usuario;
header('Location: ../administrador/administrador.php');
}else{
header('Location: index.php');
}
}
?>
?>