Ver Mensaje Individual
  #23 (permalink)  
Antiguo 22/10/2010, 16:03
trinipau
(Desactivado)
 
Fecha de Ingreso: agosto-2009
Mensajes: 37
Antigüedad: 14 años, 8 meses
Puntos: 0
Respuesta: Validacion de inicio de sesión

Cita:
Iniciado por celineadiction Ver Mensaje
Este es el codigo de la pagina donde se tiene qu hacer el Log In
que debe mandar al archivo valida.php para verificar que el usuario existe

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
<link href="estilo.css" rel="stylesheet" type="text/css" media=screen>
<title>Inicio de Sesión</title>
</head>
<body>

<?php
session_start();
mysql_connect("localhost","root","admin");
mysql_select_db("alumnos");

echo "<fieldset id='Field1'><legend> Iniciar Sesi&oacute;n</legend>
<div id='LogIn'>
<form action='valida.php' method='post'>
<table>
<tr>
<td>Usuario</td>
<td><input type='text' name='nombreUsuario' size='30'></td>
</tr>

<tr>
<td> Contrase&ntilde;a</td>
<td> <input type='password' name='clave' size='30'></td>
</tr>

<tr>
<td valign='bottom' align='center' colspan='2'><input type='submit' value='Entrar'></td>
</tr>
</table>
</form>
</div>


</fieldset>";

?>

</body>
</html>
aok pero por que estas imprimiendo todo el codigo de html? aparte por que mandas hacer una conecion atu bd de datos en este parte del coigo no cres que estaria mejor asi


Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
 <head>
	<link href="estilo.css" rel="stylesheet" type="text/css" media=screen>
  <title>Inicio de Sesión</title>
 </head>
<body>

 <fieldset id='Field1'><legend> Iniciar Sesi&oacute;n</legend>
		<div id='LogIn'>
		<form action='valida.php' method='post'>
		<table>
			<tr>
			<td>Usuario</td>
			<td><input type='text' name='nombreUsuario' size='30'></td>
			</tr>

			<tr>
			<td> Contrase&ntilde;a</td>
			<td> <input type='password' name='clave' size='30'></td>
			</tr>
			
			<tr>
			<td valign='bottom' align='center' colspan='2'><input type='submit' value='Entrar'></td>
			</tr>
		</table>
		</form>
		</div>


</fieldset>

 

</body>
</html>