authentif.php< ?php
include("param.inc") ;
function Authentification()
header(’WWW-Authenticate : Basic realm="ACCES RESTREINT"’) ;
header(’HTTP/1.0 401 Unauthorized’) ;
echo ’Procédure annulée’ ;
exit ;
;
if (!isset($_SERVER[’PHP_AUTH_USER’]))
Authentification() ;
else
if (($_SERVER[’PHP_AUTH_USER’]==$myuser)&&($_SERVER[’PHP_AUTH_PW’]==$mypw))
echo "OK" ;
else
Authentification() ;
;
?>param.inc< ? (...)
Accueil > Manip’s > PHP > Leçons PHP > Authentification