ciao, guarda qst pagina:
http://www.php.net/manual/it/features.http-auth.php