I\'m trying to use Basic HTTP Authentication and followed the example on the PHP manual page. But it doesn\'t work for me. The variable $_SERVER[\'PHP_AUTH_USER\']
I think the PHP methods rely on Basic Authentication being configured on the Web Server. An easy way to do this is to include a .htaccess file in the directory you want to enable basic authentication for.
Most unix-based web hosts allow you to do this by just uploading this file. A separate file (call this .htauth) will hold the user logins that are allowed to access the site or directory.