Tema: problema
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/10/2005, 23:04
blackrocha
 
Fecha de Ingreso: noviembre-2004
Mensajes: 181
Antigüedad: 19 años, 5 meses
Puntos: 1
problema

hola amigos les quiero contar que tengo un problema con el inicio de secion ya que tengo este pedaso de codigo
y me arroja unos failed

aqui esta el codigo de el inico de sesion
<?php
session_start();
echo "<html>\n";
echo "<head>\n";
echo "<title>Inicio de sesion</title>\n";
echo "</head>\n";

echo "<body bgcolor='#003399' text='#00FF99'>\n";

if($btningresar)
{
$enlace = mysql_connect("localhost", "root", "") or die("No pudo conectarse : " . mysql_error());
mysql_select_db("hospital") or die("No pudo seleccionarse la BD.");

$consulta="SELECT usuario.login,usuario.pas FROM usuario where LOGIN='$txtlogin' and PAS='$txtpassword'";
$res=mysql_query($consulta) or die("La consulta fall&oacute;: " . mysql_error());
mysql_close();
$num=mysql_numrows($res);

if ($num)
{
echo "<center>DATOS INGRESADOS CORRECTAMENTE</center><br>";
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>Mi Inicio</b></h2></center><br><br>\n";

echo "<form action='$PHP_SELF' method='post'>\n";

echo "<center>\n";
echo "<table border='1' width='100' height='74'>\n";
echo " <tr> \n";
echo " <td width='50%' height='19'><strong><font face='Verdana'>Login</font></strong></td>\n";
echo " <td width='50%' height='19'><input name='txtlogin' type='text' size='15' maxlength='10'></td>\n";
echo " </tr>\n";

echo " <tr> \n";
echo " <td width='50%' height='18'><strong><font face='Verdana'>Password</font></strong></td>\n";
echo " <td width='50%' height='18'><input name='txtpassword' type='password' size='15' maxlength='10'></td>\n";
echo " </tr>\n";

echo "<tr> \n";
echo " <td><center><a href='../../externo/primcipio.php'><img src='../general/imagen/mano.gif'

border='o'></a></td></center>\n";
echo " <td><input type='submit' value='Ingresar' name='btningresar'></td>\n";
echo "</tr>\n";

echo "</table>\n";
echo "</center>\n";

echo "</form>\n";
echo "</body>\n";
echo "</html>\n";
}
?>


y este es el error que me arroja y no lo puedo pillar ayudenme porfa

Notice: Undefined variable: btningresar in c:\archivos de programa\easyphp1-8\www\index.php on line 10

Notice: Undefined variable: PHP_SELF in c:\archivos de programa\easyphp1-8\www\index.php on line 38

gracias de ante mano