Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/02/2007, 15:47
200312171
 
Fecha de Ingreso: febrero-2007
Mensajes: 1
Antigüedad: 18 años, 1 mes
Puntos: 0
Re: seguridad-php+mysql

q tal soy nuevo en php y tengo un problema en el login quiero validar las cajas de texto osea q no esten vacias si si estan no tener acceso a otra pagina quiero restringir ese acceso porfa
he restrigindo con script pero nmo funciona
Código PHP:
<?
session_start
();
?>
<html><head><title>Necesita identificación! </title>
<script language="JavaScript">
    function valida()
    {
        if(form.pass.value=="")
        {
        alert("Dato 1");
        form.pass.focus();
        retun
        }
        form.submit();
    }
</script>
</head>
<?
if(isset($SESSION))
{

header("location:user.php"); /* Si ha iniciado la sesion, vamos a user.php */


else { 
?>
<body>
<center><h1>Identificate! :D </h1></center>
<table align="right" width="100" bordercolor="#0033CC"border="0" cellpadding="0" cellspacing="0">
<form action="comprueba.php" method="POST">
<tr>
<td> Login: <input type="text" name="login" ><br></td>
</tr>
<tr>
<td> Password:  <input type="password" name="pass" ><br></td></tr>
<tr>
    <td><input type="submit" value="Entrar" onClick="valida(this.form)"></td>
    <!--<td><input type="button" value="Entrar" onClick="valida(this.form)"></td>-->
    </tr>
</form>
</table>
</body></html>
<?
/* Y cerramos el else */ 
?>

Última edición por jam1138; 14/02/2007 a las 20:34