Este es el de logearse:
Código PHP:
<?php
echo "<html><head><title>Login de Usuarios</title><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head>
<body background=\"img/back.gif\" topmargin=\"0\" leftmargin=\"0\" align = \"center\">
<td><table width=\"85%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td> <div align=\"left\"><img src=\"img/loginusuarios.gif\" width=\"653\" height=\"132\"></div></td>
</tr>
<tr>
<td>
<table width=\"85%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td><blockquote><form name=\"form\" method=\"post\" action=\"checkuser.php\">
<table><tr><td><p> </p></td></tr></table>
<table><tr><td><p> </p></td></tr></table>
<table><tr><td><p> </p></td></tr></table>
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">
<tr>
<td width=\"17%\">Login(*):</td>
<td width=\"89%\"><input name=\"login\" type=\"text\" size=\"25\" maxlength=\"25\"></td>
</tr>
<tr>
<td>Password(*):</td>
<td><input name=\"password\" type=\"password\" size=\"25\" maxlength=\"25\"></td>
</tr>
<tr>
<td colspan=\"2\"><input name=\"enviar\" type=\"submit\" value=\"Entrar ...\"></td>
</tr>
</table>
</form> </blockquote></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>";
?>
y este es el checkuser.php
Código PHP:
<?php
$link = mysql_connect("localhost","","");
$consult = "SELECT * FROM registro WHERE login ='$login'";
$result = mysql_query($consult);
if($row = mysql_fetch_array($result)){
if ($row['password'] == $password)) {
echo "Ahora sí";
header("Location:upload.php");
exit();
} else {
echo "<font face=\"Tahoma\" size=\"2\">Contraseña inválida.</font>";
}
} else {
echo "<font face=\"Tahoma\" size=\"2\">Nombre de usuario no válido.</font> " . mysql_error();
}
mysql_close();
?>