conexion.php
Código PHP:
<? function conectarse() {
if (!($link=@mysql_connect("127.0.0.1","root","")))
{ echo "Error conectando a la base de datos.";
exit(); }
if (!(mysql_select_db("recarga",$link)))
{ echo "Error seleccionando la base de datos.";
exit(); }
return $link; } ?>
Código PHP:
<html>
<head>
<title>RECARGAS.....................Ingreso de Usuarios</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p> </p>
<p> </p>
<p> </p>
<table width="75%" border="1" bordercolor="#FFFFFF">
<tr>
<td width="52%"><font color="#FFFFFF"> </font></td>
<td width="44%"> <img src="Celular.jpg" width="203" height="209"></td>
<td width="4%"> </td>
</tr>
<tr>
<td><font color="#FFFFFF"> </font></td>
<form action="logeado.php">
<td>Usuario
<input name="$usua " type="text" id="$usua "></td>
<td> </td>
</tr>
<tr>
<td><font color="#FFFFFF"> </font></td>
<td>Password
<input name="$pass" type="password" id="$pass"></td>
<td> </td>
</tr>
</table>
<table width="75%" border="1" bordercolor="#FFFFFF">
<tr>
<td width="61%"> </td>
<td width="34%">
<input type="submit" name="Enviar" id="Enviar" value="Enviar">
</td></form>
<td width="5%"> </td>
</tr>
</table>
<p> </p>
</body>
</html>
logueado.php
<?php require_once('conexion.php'); ?>
<?php
//session_register('l');
//session_register('p');
if($usua!="" && $pass!=""){
$l=$usua;
$p=$pass;
}
$link=conectarse();
$sql = mysql_query("SELECT * FROM usuarios where usuario='$usua' and password='$pass' ",$link);
$fil = mysql_num_rows($sql);
if($fil!=0){
//echo"Datos Correctos";
echo"<SCRIPT LANGUAGE='javascript'>";
echo"location.href = 'menu.html'";
echo"</SCRIPT>";
//echo"<br> <a href='./logout.php'>Salir de forma segura</a>";
}else{
echo"<SCRIPT LANGUAGE='javascript'>";
echo"alert ('Nombre De Usuario O Contrasena 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=index.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 Administracion...<br>
</code></b><code><br>
<br>
<font style="font-size:17"><br>
Ingreso al Panel de Administracion</font></code><b><code><br>
<font color="#000000">RECARGAS MOVILES</font><br>
<br>
</code>SESION INACTIVA</font>
</center></body></html>';
exit();
}
?>
<html>
<head>
<title>Documento sin título</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
Luis Alfonso
![sonrisota](http://static.forosdelweb.com/fdwtheme/images/smilies/xD.png)