holas amigos como estan saben les cuento lo q nesesito: 
nesesito q cuando ingrese el pass y el loggin y si este es erroneo embie solo un cuadro de advertencia q ingrese denuevo ya q no existe y se regargue la pagina 
si quieren les muestro la pagina como esta construida para q me puedan guiar como hacerlo muchas gracias.
 
//pagina
<?php 
session_start(); 
 
if(isset($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ó: " . mysql_error()); 
mysql_close(); 
$num=mysql_numrows($res); 
 
if ($num) 
{ 
 
session_register('LOGIN'); $LOGIN=$txtlogin; 
header("Location:agregarpaciente.php"); 
 
exit; 
} 
else 
{ 
 
 
echo "<html>\n"; 
echo "<head>\n"; 
echo "<title>Inicio de sesion</title>\n"; 
echo "</head>\n"; 
 
echo "<body bgcolor='#FFFFCC' text='#00FF99'>\n"; 
echo "<center><h3><b>INGRESE SUS DATOS CORRECTAMENTE<b><h3></center>"; 
echo "<a href='$_SERVER'><center>ATRAS</center></a>"; 
} 
 
} 
 
else 
{ 
 
 
echo "<form action='$_SERVER' method='post'>\n"; 
echo "<center>\n"; 
//
echo"<td><img src='/imagen/fotoh1.jpg' width='1024' height='200'></a></td>\n";
//
//foto
echo "<center><h2><b>Inicio</b></h2></center><br><br>\n"; 
echo "<table border='1' width='100' height='74'>\n"; 
 
echo " <tr> \n"; 
echo " <td width='50%' height='19' bgcolor='#FFFFCC'><strong><font face='Times New Roman, Times, serif' size='1'>Login</font></strong></td>\n"; 
echo " <td width='50%' height='19' bgcolor='#FFCC00'><input name='txtlogin' type='text' size='15' maxlength='10'></td>\n"; 
echo " </tr>\n"; 
 
echo " <tr> \n"; 
echo " <td width='50%' height='18' bgcolor='#FFFFCC'><strong><font face='Times New Roman, Times, serif' size='1'>Password</font></strong></td>\n"; 
echo " <td width='50%' height='18' bgcolor='#FFCC00'><input name='txtpassword' type='password' size='15' maxlength='10'></td>\n"; 
echo " </tr>\n"; 
 
echo "<tr> \n"; 
echo " <td bgcolor='#FFFFCC'><center></td></center>\n"; 
echo " <td bgcolor='#FFFFCC'><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"; 
} 
?> 
 
 
gracias de antemano 
   
 


