Código PHP:
Ver original<?php
//initialize the session
}
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){ $logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']); }
?>
<?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;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); }
?>
<?php require_once('localhost1.php'); ?>
<?php
// *** Validate request to login to this site.
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) { $_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['Nombre'])) { $loginUsername=$_POST['Nombre'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "tabular.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
// $LoginRS__query=sprintf("SELECT usr, passwd FROM usuarios_sha1 WHERE usr=%s AND passwd=%s",
$LoginRS__query=sprintf("SELECT * FROM tabular WHERE folio='$loginUsername'",
GetSQLValueString($loginUsername, "text"));
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
//$_SESSION['MM_Id'] = $loginRS[2];
if (isset($_SESSION['PrevUrl']) && false) { $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
echo "
<script language='Javascript'>
window.open(\"tabular.php\",\"tabular\",\"fullscreen,scrollbars\");
</script>";
//header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed ); }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index</title>
</head>
<body bgcolor="#FF9400">
<form action="" method="POST">
<center>
<h1>Bienvenidos al proyecto de SEP Becas de Preparatoria</h1>
<table width="550" border="1" bordercolor="#BF8330">
<tr>
<td colspan="2" bgcolor="#A66000"><div align="center">
<h2>Por favor escribe tu nombre y tu contraseña</h2>
</div></td>
</tr>
<tr>
<td>Teclea el folio</td>
<td><label>
<input name="Nombre" type="text" id="Nombre" size="9" maxlength="9" onkeyup = "this.value=this.value.toUpperCase();" />
</label></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Entrar" id="Entrar" value="Entrar a Capturar" />
</div></td>
</tr>
</table>
</center>
</form>
</body>
</html>