0

I have a client that wants users to access a private area on their HTML website to download resources.

Just wanted your advice on what the best solution would be to set this up.

My knowledge in PHP is pretty poor.

We have also spoke about moving their website over to a CMS such as wordpress. Would this be easier to do with Wordpress via a plugin, or is it just as easy to implement on a static HTML site?

Any advice would be greatly appreciated.

4

2 回答 2

2

我认为在您的情况下,最简单的方法是创建一个 htpasswd 文件。

.htaccess文件放在您希望私有的目录中并写入:

AuthUserFile /real/path/to/file/.htpasswd
AuthType Basic
AuthName "Secreat place"
require valid-user

.htpasswd写入用户和加密密码:

admin:$apr1$nOq27Mwz$xnM1lIqrwyvbBmp0V/.TJ1

PS:这个代表密码admin

于 2012-09-27T12:14:25.177 回答
0

这取决于很多很多事情。我建议您搜索user authentication php并选择最适合您需求的解决方案。然后,如果您在实施它时遇到麻烦,请在 Stack 上提问。

于 2012-09-27T12:17:40.590 回答