Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/05/2005, 06:04
Avatar de 8461277
8461277
 
Fecha de Ingreso: diciembre-2002
Ubicación: san juan de los morros
Mensajes: 887
Antigüedad: 21 años, 3 meses
Puntos: 1
Autenticacion via http a una BD????

amigo tengo este codigo, el cual autentifica a un usuario a traves de bd, que hay de malo en ella:


<?
/* Autenticación
*/
$muerte = 'Acceso Denegado!!!! :-p';
if(!isset($PHP_AUTH_USER)) {
header('WWW-unerg.edu.ve: Basic realm="UNERG"');
header('HTTP/1.0 401 Unauthorized');

echo $muerte;
exit;
} else {
// valido mi clave en el servidor ...
if (@$db_link = mysql_connect("localhost", "root", "")) {
@mysql_select_db("noti_php");
}
$sql = "select * from acceso
where ((usr_login = '$PHP_AUTH_USER')
and (usr_pass = '$PHP_AUTH_PW')) ";
$qpass= mysql_query($sql, $db_link);
if(mysql_num_rows($qpass)<>1) {
echo $muerte;
exit;
}
}
?>

me arroja el siguiente error:

linea 7: Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\pagina universidad 23-05-05\principal\seguridad.php:2) in c:\wamp\www\pagina universidad 23-05-05\principal\seguridad.php on line 7

Linea 8: Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\pagina universidad 23-05-05\principal\seguridad.php:2) in c:\wamp\www\pagina universidad 23-05-05\principal\seguridad.php on line 8
LAS LINEA EN NEGRITAS SON LA 7 Y O RESPECTIVAMENTE

Me pueden explicar que pasa
__________________
Miguel Padrón :cool: