예제 #1
0
<?php

$accion = filter_input(INPUT_POST, 'accion');
require_once '../DTO/ClsMedico.php';
$objDto = new ClsMedico();
switch ($accion) {
    case 'verificarUsuario':
        verificar($objDto);
        break;
    default:
        echo "<h1>Default de sw</h1>";
}
function verificar($objDto)
{
    $objDto->setCedula(filter_input(INPUT_POST, 'cedula'));
    $objDto->setContrasena(filter_input(INPUT_POST, 'pass'));
    require_once '../Modelo/ModMedico.php';
    $objMod = new ModMedico();
    $response = $objMod->login($objDto);
    echo $response;
}
예제 #2
0
<?php

include "../model/usuarios.php";
$user = $_POST['usuario'];
$pas = $_POST['Password'];
$rpta = verificar($user, $pas);
if ($rpta == 1) {
    header("Location: ../inicio.php");
} else {
    header("Location: ../index.html?error=error");
}
예제 #3
0
function verificar($arrray, $key)
{
    if (array_key_exists($key, $arrray)) {
        $key = $key + 1;
        $key = verificar($arrray, $key);
    }
    return $key;
}