Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/06/2005, 16:12
Avatar de Seppo
Seppo
 
Fecha de Ingreso: marzo-2005
Ubicación: Buenos Aires, Argentina
Mensajes: 1.284
Antigüedad: 19 años, 1 mes
Puntos: 17
A ver con esto...
Código PHP:
   if (!isset($_SERVER['PHP_AUTH_USER'])) {
      
header('WWW-Authenticate: Basic realm=" Zona Restringida "');
      
header('HTTP/1.0 401 Unauthorized');
      echo 
'ZONA RESTRINGIDA: se requiere autorización.';
      exit();
   } else {
       if ((
$_SERVER['PHP_AUTH_USER'] == 'jefe') && ($_SERVER['PHP_AUTH_PW'] == 'superjefe')) {
        echo 
'<H2 ALIGN="CENTER">Zona Restringida</H2>';
        echo 
'Buenos días oscar';
       } else {
        
header('WWW-Authenticate: Basic realm=" Zona Restringida "');
        
header('HTTP/1.0 401 Unauthorized');
        echo 
'ZONA RESTRINGIDA: se requiere autorización.';
        exit();
       }
   }