The fastest and easiest way to do basic authentication on the web is with .htaccess/.htpasswd. Let me remind you how to do this:
1. Create a file on the server:
AuthName "Your authorization required message."
php_value display_errors 1
In AuthUserFile, you need to set the absolute path to the login-password file. To find out the path, we put the script in the folder:
echo dirname(__FILE__) . '/.htpasswd';
Open it and find out the way.
2. Create file
vasya:<password in MD5>
Note that a normal MD5 generator will not work, apache has its own MD5 hash structure. Google “md5 .htaccess” giner
3. Make a link for auto-entry