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

后端 未结 5 1033
温柔的废话
温柔的废话 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 04:55

    Well since you know it's insecure to begin with, you could store a password in a text file somewhere on your web server. When someone accesses the page you could show a form that asks for a password. If the password matches what is in the text file, then you reload the page and display the information. Using the text file will allow you to change the password without having to modify the page they are accessing when you want to change it. You're still going to be sending plaintext everywhere unless you're using SSL. Let me know if you need some code.

提交回复
热议问题