Ver Mensaje Individual
  #7 (permalink)  
Antiguo 28/08/2006, 09:40
Avatar de teseedith
teseedith
 
Fecha de Ingreso: junio-2006
Mensajes: 14
Antigüedad: 17 años, 10 meses
Puntos: 0
Hola Cluster

La verdad apenas empece a utilizar php y mi sistema es muy basico. Hay muchas cosas que todavia no entiendo. Para ver si me puedes aclarar un poco más mi duda te mando el codigo de mis contraseñas
<?php
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="INTRODUCE NOMBRE DE USUARIO Y CONTRASEÑA"');
header('HTTP/1.0 401 Unauthorized');
echo 'NOMBRE DE USUARIO O CONTRASEÑA INCORRECTA.';
exit;
}

$fich = file("passwords2.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 'NOMBRE DE USUARIO O CONTRASEÑA INCORRECTA.';
exit;
}
echo "<script type='text/javascript'>document.location.href = 'MENUALMACEN.php';</script>";
?>

Otra duda que tengo el sistema va a utilizar muchos usuarios necesito crear sesiones y cookies
Gracias por el tiempo que te has tomado ayudandome y gracias de antemano por el que me sigas otorgando.