有没有办法在不使用服务器端语言的情况下对 HTML 页面进行密码保护?

2022-01-22 00:00:00 client passwords javascript html

我有一系列相互关联的网页,我想通过要求用户提供登录名和密码来限制对这些网页的访问.但是,我的托管帐户目前不提供任何服务器端脚本功能 - 有什么方法可以仅使用客户端脚本来实现此目标?

I have a series of interlinked web pages, and I want to restrict access to these pages by asking the user to provide a login and password. However, my hosting account currently does not provide any facility for server side scripting - is there any way I can accomplish this objective using only client side scripts?

我想知道下面的程序是如何工作的 -

I was wondering how the following program works -

http://www.myzips.com/software/HTML-Password.phtml

澄清:感谢您的意见.但是,如果我正在配置 Web 服务器,那么用户是否有可能输入用户名和密码?

Clarification: Thanks for your inputs. However, if I am configuring the web server, then is there a possibility of the user entering an username and password?

推荐答案

没有办法创建安全的客户端脚本.如果用户可以访问它,它就是不安全的.

There is no way to create a secure clientside script. If the user has access to it, it's insecure.

如果您的主机运行的是 apache,您可以使用 .htaccess 保护文件夹,在 IIS 上,您可以通过目录安全保护文件夹.

If your host is running apache you can secure folders using .htaccess, on IIS you can do the same through directory security.

相关文章