我有一个网页,每 5 分钟刷新一次客户详细信息。我已经通过基本和标准的 htaccess 和 htpassword 文件类型登录系统为其添加了用户名密码,因为文件的一部分包含公司数据。
但我需要在我的工作 PC 上打开相同的网页,这是一台连接到显示屏的安全 PC 以显示相同的网页。
在断电或互联网断开时,PC 有一个带有此网页快捷方式的启动文件,因此它会自动出现,但会从 401 授权登录表单停止。所以在我填写详细信息之前不要走。
有没有一种方法可以让我用 php 或 javascript 或 jquery 代码保存一个文件,以便它可以将用户名密码提供给它并打开网页(甚至作为 iframe)?
无需担心文件的安全性 - PC 被锁在一个柜子里,柜子里只有一小部分孔用于通风和连接显示器的显示电缆,还有一个小孔用于连接电源按钮。
如果您知道在 Android 上执行此操作,也请告诉我。
找到答案了!!请参阅下面我的帖子!
最佳答案
UPDATE: This answer may no longer work in newer browsers.
Because phishing people use @ and : marks in URL to hide URLs. For example in a URL like www.facebook.com:somelongtext@www.notfacebook.com user will oversee @notfacebook.com part and enter login details to a phishing webpage without noticing the latter. So now either this method will not simply work or either you will see a warning saying this URL maybe a phishing site. So even if it's a private webpage where only you have access to it browser will try its protective mechanisms.
找到答案了!
可以从 URL 本身传递它!
http://username:password@www.yourdomain.com
并且 url 的内容也被隐藏了 据我所知,也是全局兼容的!
关于javascript - 自动验证 htaccess (401) 用户名密码登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21290015/