17/07/2007, 15:33
|
| | | Fecha de Ingreso: mayo-2007 Ubicación: Monterrey, N.L. México.
Mensajes: 212
Antigüedad: 17 años, 6 meses Puntos: 0 | |
Re: limpiar campo de texto... Este es el código de toda la pagina
<?php require_once('Connections/prueba.php'); ?><?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['Cusuario'])) {
$loginUsername=$_POST['Cusuario'];
$password=$_POST['Cpassword'];
$MM_fldUserAuthorization = "nivel";
$MM_redirectLoginSuccess = "private.php";
$MM_redirectLoginFailed = "denegado.html";
$MM_redirecttoReferrer = false;
mysql_select_db($database_prueba, $prueba);
$LoginRS__query=sprintf("SELECT usuario, password, nivel FROM datos_notario WHERE usuario='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $prueba) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = mysql_result($LoginRS,0,'nivel');
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
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=iso-8859-1" />
<title>Documento sin título</title>
<style type="text/css">
<!--
.Estilo1 {color: #FFFFFF}
body {
background-color: #E5E5EB;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>
<body>
<form action="<?php echo $loginFormAction; ?>" method="POST" name="datos_ingreso" target="_blank" id="datos_ingreso">
<p> </p>
<table width="251" border="0" align="center">
<tr>
<td width="98"><div align="right">Usuario:
</div></td>
<td width="143"><input name="Cusuario" type="text" id="Cusuario" size="17" maxlength="15" /></td>
</tr>
<tr>
<td height="27"><div align="right">Password:</div></td>
<td height="27"><input name="Cpassword" type="password" id="Cpassword" size="17" maxlength="15" /></td>
</tr>
<tr>
<td height="52" colspan="2"><div align="center">
<p>
<input name="entrar" type="submit" id="entrar" onclick="MM_validateForm('Cusuario','','R','Cpassw ord','','R');return document.MM_returnValue" value="Entrar" />
</p>
</div></td>
</tr>
</table>
</form>
<table width="237" border="0" align="center">
<tr>
<td width="227"><div align="center"><strong>Para acceder a esta información </strong></div></td>
</tr>
<tr>
<td><div align="center"><strong>es necesario darse de alta.</strong></div></td>
</tr>
<tr>
<td height="41"><div align="center"><strong>Gracias.</strong></div></td>
</tr>
<tr>
<td height="36"><div align="center"><a href="capt_registro.php"><strong>Haga Click Aqui </strong></a></div></td>
</tr>
</table>
</body>
</html> |