lo estas haciendo mal , LO HAS PUESTO FUERA DE PHP.
Código PHP:
Ver original<?php
require_once('../Connections/conex.php');
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ?
intval($theValue) : "NULL"; break;
case "double":
$theValue = ($theValue != "") ?
"'" . doubleval($theValue) . "'" : "NULL"; break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['Usuario'])) { $loginUsername=$_POST['Usuario'];
$password=$_POST['Password'];
$MM_fldUserAuthorization = "Estatus";
$MM_redirectLoginSuccess = "PanelControl/Administradores/Validar.php";
$MM_redirectLoginFailed = "Error.php";
$MM_redirecttoReferrer = false;
$LoginRS__query=sprintf("SELECT Usuario, Password, Estatus FROM usuarios WHERE Usuario=%s AND Password=%s", GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));
if ($loginFoundUser) {
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
$_SESSION['MM_Nombres'] = $row['Nombres'];
$_SESSION['MM_NumIngreso'] = $row['NumIngreso'];//ESTO LO NECESITO IMPLEMENTAR
$_SESSION['MM_UltimoIngreso'] = $row['UltimoIngreso'];//ESTO LO NECESITO IMPLEMENTAR
$_SESSION['MM_IngresoHora'] = $row['IngresoHora'];//ESTO LO NECESITO IMPLEMENTAR
if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess ); }
else {
header("Location: ". $MM_redirectLoginFailed ); }
}
?>