What is the best way to password protect folder/page using php without a db or username

后端 未结 5 1024
温柔的废话
温柔的废话 2020-11-28 04:29

What is the best way to password protect folder using php without a database or user name but using. Basically I have a page that will list contacts for organization and ne

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 05:00

    If you want to avoid cookies, sessions and don't want to play with .htaccess files, you can also do http authentication soley with PHP:

    http://www.php.net/manual/en/features.http-auth.php

    You can hard code the password into the file and change it as needed, or include it from a file not in your web_accessible directory.

    The downside is you don't have the ability to format the "login" screen - it will be a standard http authentication dialog box

提交回复
热议问题