|
PHP_AUTH_USER
|
Informations rapides |
|
|
Informations détaillées
|
Description :
Exemple d'utilisation de la fonction header avec PHP_AUTH_USER
Portion de code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
<? if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic entrer="Entrer dans la page" "); Header("HTTP/1.0 401 Unauthorized"); echo "Action annuler !n"; exit; } else { if ( ($PHP_AUTH_USER == "script") && ( $PHP_AUTH_PW == "zone" )) { //pour rediriger apres verification du pass header("location: ok.htm"); } else { //si le passe et pas bon echo "<html><body>Bad password !<P></body></html>"; } } ?> |
|
Informations & Services |
 |
|
|
 |
Newsletter
Autre Sources
Tips
|