![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/02/2004, 20:50
|
| | Fecha de Ingreso: febrero-2004
Mensajes: 22
Antigüedad: 21 años Puntos: 0 | |
index.htm
Código:
<html><head></head><body>
<form name="identificacion" method="post" action="adherentes-auth.php">
<table border="0" cellspacing="3" width="50%" cellpadding="0" id="AutoNumber9">
<tr>
<td width="67%" colspan="2">
<p align="center">
<font face="Arial" size="2" color="#FF0000">
<b>Ingrese su identificación</b></font></td>
</tr>
<tr>
<td width="33%">
<p align="right"><b>
<font face="Trebuchet MS" size="2" color="#800000">
Nombre de usuario:</font></b></td>
<td width="34%">
<input type="text" name="usuario" size="20" style="font-family: Trebuchet MS; font-size: 10pt; color: #800000; font-style: italic; font-weight: bold; border: 1px solid #000080; padding-left: 3; padding-right: 3; padding-top: 0; padding-bottom: 0"></td>
</tr>
<tr>
<td width="33%">
<p align="right"><b>
<font face="Trebuchet MS" size="2" color="#800000">
Contraseña:</font></b></td>
<td width="34%">
<input type="password" name="password" size="20" style="font-family: Trebuchet MS; font-size: 10pt; color: #800000; font-style: italic; font-weight: bold; border: 1px solid #000080; padding-left: 3; padding-right: 3; padding-top: 0; padding-bottom: 0"></td>
</tr>
<tr>
<td width="67%" colspan="2">
<p align="center">
<input type="submit" value="identificar" name="B1"></td>
</tr>
</table>
</form>
</body></html>
adherentes-auth.php
Código:
<?
//conecto con la base de datos
$conn = mysql_connect("localhost","","");
//selecciono la BBDD
mysql_select_db("neo_anime",$conn);
//tienes que tener cuidado ya que esto discrimina entre mayusculas y minusculas
$sql = mysql_query("SELECT * FROM cmt WHERE usuario = '$_POST[usuario]' and password = '$_POST[password]'", $conn);
while ($resultado = mysql_fetch_array($sql)) {
//aqui volcamos los datos del usuario que tiene dichos datos
$usuario = $resultado[usuario];
$ID_user = $resultado[id];
}
if (isset($ID_user)) {
$mostrardatos = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td width=\"100%\" colspan=\"3\">
<p align=\"center\"><font face=\"Arial\" size=\"2\" color=\"#800000\"><b>PANEL DE
CONTROL</b></font></td>
</tr>
<tr>
<td width=\"33%\"><FORM ACTION=\"adherentes-edicion.php\" METHOD=\"POST\">
<input type=\"image\" SRC=\"002.jpg\" width=\"100\" height=\"100\" size="20"><input type=\"hidden\" name=\"ID\" size=\"20\" value=\"$ID_user\"></form></td>
<td width=\"33%\"><FORM ACTION=\"adherentes-edicion.php\" METHOD=\"POST\">
<input type=\"image\" SRC=\"002.jpg\" width=\"100\" height=\"100\" size="20"><input type=\"hidden\" name=\"ID\" size=\"20\" value=\"$ID_user\"></form></td>
<td width=\"34%\"><FORM ACTION=\"adherentes-edicion.php\" METHOD=\"POST\">
<input type=\"image\" SRC=\"002.jpg\" width=\"100\" height=\"100\" size="20"><input type=\"hidden\" name=\"ID\" size=\"20\" value=\"$ID_user\"></form></td>
</tr>
</table>";
} else { $mostrardatos = "<p align=\"center\"><span lang=\"es\"><font face=\"Arial\" size=\"2\" color=\"#FF0000\">
<b>ERROR EN SU NOMBRE DE USUARIO O CONTRASEÑA<br>
</b></font><b><font face=\"Arial\" size=\"2\" color=\"#800000\">(tenga en cuenta las
mayúsculas y minúsculas)</font></b></span></p>"; }
?>
<html><head></head>
<body><center><?php echo $mostrardatos ?></center></body></html>
Última edición por Van Fanel; 13/02/2004 a las 21:05 |