Código PHP:
<?php require_once('conexion.php'); ?>
<?php
session_register('l');
session_register('p');
if($usuario!="" && $clave!=""){
$l=$usuario;
$p=$clave;
}
$link=conectarse();
$p = md5($p);
$sql = mysql_query("SELECT * FROM usuario where usuario='$l' and password='$p' and id_perfil=1",$link);
$fil = mysql_num_rows($sql);
if($fil!=0){
echo"Datos Correctos";
echo"<SCRIPT LANGUAGE='javascript'>";
echo"location.href = 'bienvenida_admin.php'";
echo"</SCRIPT>";
}
$p = md5($p);
$administrador = mysql_query("SELECT * FROM usuario where usuario='$l' and password='$p' and id_perfil=2",$link);
$fila = mysql_num_rows($administrador);
if($fila!=0){
echo"Datos Correctos";
echo"<SCRIPT LANGUAGE='javascript'>";
echo"location.href = 'index.php'";
echo"</SCRIPT>";
}
else{
echo"<SCRIPT LANGUAGE='javascript'>";
echo"alert ('Nombre De Usuario O Contraseña Invalido')";
echo"</SCRIPT>";
echo '<html><head><title>SuperSlot</title>
<style type="text/css">
A:link {color:#008000 ; text-decoration:none}
A:visited {color:#c7caed ; text-decoration:none}
A:active {color:#000080 ; text-decoration:none}
A:hover {color:#000000 ; text-decoration:underline}
</style>
<meta http-equiv="refresh" content="1; url=principal_admin.php"></head>
<body bgcolor=#f6f6f6 style="border:29 solid #dddddd" scroll=no>
<br>
<br><br><center>
<font style="font-size:25" color=#000033><b><code>Cargando Administración...<br>
</code></b><code><br>
<br>
<font style="font-size:17"><br>
Ingreso al Panel de Administración</font></code><b><code><br>
<font color="#000000">Proyecto Ingenieria Kansei</font><br>
<br>
</code>SESIÓN INACTIVA</font>
</center></body></html>';
exit();
}
?>
Código PHP:
<html>
<head>
<title>Entrada al Sistema</title>
<style type="text/css">
<!--
.Estilo1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.Estilo2 {font-size: 18px}
.Estilo4 {font-size: 18px; font-family: Arial, Helvetica, sans-serif; }
.Estilo5 {
font-size: 16px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
.Estilo6 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.Estilo8 {font-size: 12px}
-->
</style>
<style type="text/css">
<!--
body {scrollbar-face-color:#336699;
scrollbar-highlight-color:#8FB7CF;
scrollbar-3dlight-color:#336699;
scrollbar-darkshadow-color:#5D859D;
scrollbar-shadow-color:#8FB7CF;
scrollbar-arrow-color:#EFE9E0;
scrollbar-track-color:#FFFFFF;
color:#000000;
background-color:#FFFFFF;
font-family:verdana,arial;
font-size:12px}
/* End of style section. */
-->
</style>
<script language="javascript" type="text/javascript">
//MAXIMIZACIÓN DE LA VENTANA EN QUE SE CARGA LA PÁGINA
//posiciona en la esquina superior izquierda
top.window.moveTo(0,0)
if (document.all) {
//si es el IE, usamos resizeTo para redimensionar
top.window.resizeTo(screen.availWidth,screen.availHeight)
} else if ( document.layers || document.getElementById ) {
//si Navigator, modificamos los valores de outerHeight y outerWidth
if ( top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth ) {
top.window.outerWidth = screen.availWidth
top.window.outerHeight = screen.availHeight
}
}
</script>
</head>
<body>
<table width="1024" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="79" colspan="3" valign="baseline"><img src="images/img_r1_c1.gif" width="1024" height="80"></td>
</tr>
<tr>
<td width="232" height="102"> </td>
<td width="577"> </td>
<td width="215"> </td>
</tr>
<tr>
<td height="222"> </td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F8F8F8">
<!--DWLayoutTable-->
<tr>
<td width="13" height="40"> </td>
<td width="142"> </td>
<td width="24"> </td>
<td width="379"> </td>
<td width="19"> </td>
</tr>
<tr>
<td height="6"></td>
<td></td>
<td></td>
<td rowspan="4" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#EEEEEE">
<!--DWLayoutTable-->
<tr>
<td width="13" height="48"></td>
<td width="345" valign="top"><div align="center" class="Estilo5">
<p> </p>
<p>ACCEDER AL SISTEMA</p>
<p> </p>
</div></td>
<td width="21"> </td>
</tr>
<tr>
<td></td>
<td height="90" valign="top">
<form method="post" name="form1" action="valida.php">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr valign="baseline">
<td nowrap align="right" class="Estilo2"><div align="left" class="Estilo1"><strong>Usuario:</strong></div> </td>
<td><input type="text" name="usuario" value="" size="10" /></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" class="Estilo2"><div align="left" class="Estilo6">Contraseña:</div></td>
<td><input type="password" name="clave" value="" size="10"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" class="Estilo2"> </td>
<td> </td>
</tr>
<tr valign="middle">
<td height="26" colspan="2" align="right" valign="top" class="Estilo4"> <div align="center">
<? echo'<input name="submit" type="submit" '.
$fil[6];
echo '; border:1 groove white" onClick="willSubmit=confirm('."'Ahora ingresará al área de Administración');return willSubmit;".'" value="Entrar" size=10> ';
?></td>
</tr> </table>
</form>
<td></td>
</tr>
<tr>
<td></td>
<td height="15"></td>
<td></td>
</tr>
</table></td>
<td></td>
</tr>
<tr>
<td height="53"></td>
<td valign="top"><div align="center"><img src="images/password.png" width="72" height="67"></div></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="94"> </td>
<td valign="top" bgcolor="#F8F8F8" class="Estilo1"><div align="justify">
<p class="Estilo8">Bienvenido</p>
<p class="Estilo8">Para ingresar al sistema debe ingresar el nombre de usuario y contraseña </p>
</div></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="23"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="29"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></td>
<td> </td>
</tr>
<tr>
<td height="327"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td height="192"> </td>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
chao