Bonjour à toutes et à tous, j'ai réalisé un script d'authentification qui fait appel à une boîte de dialogue. Le problème, c'est que je ne sais pas pourquoi ma page ne veut pas s'ouvrir lorque mon login et password sont exacts :
<?php
chmod ("auth2.php", 755);
$nom="toto";
$mpasse="titi";
function demander()
{ global $PHP_SELF, $serveur;
$page = basename($PHP_SELF);
echo "<h1>401 Authorization Required</h1>";
echo "Cliquez <a href=\"
[ Lien ]">
<b>ici</b></a> pour ré-essayer";
}
function authentifier()
{ header("WWW-Authenticate:
Basic realm=\"Mon domaine\"");
header("HTTP/1.0 401 Unauthorized");
demander();
exit;
}
authentifier();
if (isset($PHP_AUTH_USER))
{
// Verification du nom et du mot de passe
if ($PHP_AUTH_USER == $nom && $PHP_AUTH_PW == $mpasse)
{
header("compte_admin.php");
exit;
}
else
{
authentifier(); //Login incorrect
}
}
?>