Bonjour, j'ai trouvé un code qui pourrait être une solution :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?php
if (!isset($_SERVER['PHP_AUTH_USER']) || isset($_REQUEST['logout']))
{
header('WWW-Authenticate: Basic realm="Acces Restreint-33"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
</head>
<body>
</body>
</html> |
je ne suis pas sûr: faut-il mettre ce code dans un fichier index.php?
De plus on nous dit d'ajouter cette ligne:
<a href="index.php?logout">Déconnexion</a>
mais ce lien n'apparaît pas quand j'affiche index.php.
Merci pour vos réponses
Partager