$username = "pippo"; $pwd = "segreta"; if(!isset($PHP_AUTH_USER)) { Header("WWW-Authenticate: Basic realm=\"Zona protetta\""); Header("HTTP/1.0 401 Unauthorized"); echo "Impossibile eseguire l'autorizzazione\n"; exit; } else { if (($PHP_AUTH_USER == $username) && ($PHP_AUTH_PW == $pwd)) { // HTML ?>