
14/10/2005, 11:47
|
| | Fecha de Ingreso: noviembre-2004
Mensajes: 181
Antigüedad: 20 años, 4 meses Puntos: 1 | |
saben me pasaron este codigo igual para probarlo y me tira el mismo error q no esta dedifida la baraiable psar este es el codigo
<SCRIPT LANGUAGE="JavaScript">
function validar()
{
login = document.form1.txtlogin.value;
pass = document.form1.txtpassword.value;
if (login == "" || pass == "")
{
alert("complete el formulario");
}
else
{
form1.submit();
}
}
</script>
<?php
echo "<html>\n";
echo "<head>\n";
echo "<title>Inicio de sesion - A.C.G.I.</title>\n";
echo "</head>\n";
echo "<body bgcolor='#003399' text='#00FF99'>\n";
//if($btningresar)
if (isset($pasar == "entra"))
{
$enlace = mysql_connect("localhost", "crodripe", "ydd402") or die("No pudo conectarse : " . mysql_error());
mysql_select_db("inventario") or die("No pudo seleccionarse la BD.");
$consulta="SELECT * FROM persona where LOGIN='$txtlogin' and PASS='$txtpassword'";
$res=mysql_query($consulta) or die("La consulta fallo ;: " . mysql_error());
mysql_close();
$num=mysql_numrows($res);
if ($num)
{
echo "<center>DATOS INGRESADOS CORRECTAMENTE</center><br>";
session_start();
session_register('LOGIN');
$LOGIN=$txtlogin;
header("Location:menu.php");
}
else
{
echo "<center><h3><b>INGRESE SUS DATOS CORRECTAMENTE<b><h3></center>";
echo "<a href='$PHP_SELF'><center>ATRAS</center></a>";
}
}
else
{ echo "<center><h2><b>Inicio de Sesión Inventario Informatica</b></h2></center><br><br>";
echo "<form method='post' action ='login.php?pasar=entra' name='form1'>";
echo "<center>";
echo "<table border='1' width='100' height='74'>";
echo "<tr>";
echo "<td width='50%' height='19'><strong><font face='Verdana'>Login</font></strong></td>";
echo "<td width='50%' height='19'><input name='txtlogin' type='text' size='15' maxlength='10'></td>";
echo "</tr>";
echo "<tr>";
echo "<td width='50%' height='18'><strong><font face='Verdana'>Password</font></strong></td>";
echo "<td width='50%' height='18'><input name='txtpassword' type='password' size='15' maxlength='10'></td>";
echo "</tr>";
echo "<tr>";
echo "<td><input type='button' value='Ingresar' name='btningresar' onclick='validar()'></td>";
echo "</tr>";
echo "</table>";
echo "</center>";
echo "</form>";
echo "</body>\n";
echo "</html>\n";
}
?>
no se cuañ es el problema
poraf una mano |