Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/07/2008, 14:25
Avatar de hoberwilly
hoberwilly
 
Fecha de Ingreso: julio-2008
Ubicación: Lima - Perú
Mensajes: 769
Antigüedad: 15 años, 10 meses
Puntos: 2
Pregunta Encriptacion Autentificacion de Usuario

Me estan solicitando encriptar el siguiente codigo:

menuAdmin.php
----------------------
<?php
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="Acceso restringido"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}

$fich = file("passwords.txt");
$i=0; $validado=false;
while ($fich[$i] && !$validado) {
$campo = explode("|",$fich[$i]);
if (($PHP_AUTH_USER==$campo[0]) && ($PHP_AUTH_PW==chop($campo[1]))) $validado=true;
$i++;
}

if (!$validado) {
header('WWW-Authenticate: Basic realm="Acceso restringido"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
?>
<!-- Manual de PHP-->


<html>
<head>
</head>
<body>
<table>
<tr>
<td">ADMINISTRADOR DE CONTENIDOS</td>
</table>
</body>
</html>

PASSWORDS.TXT
---------------------
Usuario1|Usuario1

Los cuales lo encontre en la pagina web, ...La verdad es que esto es nuevo para mi, ya que recien estoy ingresando a este fabuloso mundo que es el php...asi que acudo de su experiencia para que por favor me puedan ayudar .


Agradesco la atencion brindada, y esperando una respuesta positiva.