创建用户名/密码登录的简单方法

发布于 2024-10-06 02:18:13 字数 278 浏览 0 评论 0原文

我使用 html 和 css(在 Dreamveaver CS4 中)构建了一个网站,我想在该网站上创建一个仅注册用户可以访问的部分 - 用户必须提交其电子邮件地址并创建密码才能访问该区域。我准备花时间学习教程等,但我是一个 初学者,html 等能力有限,所以我真的很感激一些关于什么是最简单的做某事的方法的建议像这样 - Drupal? jQuery?我尝试过在线搜索教程,但我使用不同的解决方案得到了数百个不同的答案,并且非常感谢您对如何以最简单的方式做到这一点的意见。

非常感谢提前:)

I have built a website using html and css (in Dreamveaver CS4) on which I would like to create a section that is only accessible to registered users - users would have to submit their email address and create a password to access the area. I am prepared to take the time to learn with tutorials etc, but I'm a beginner with limited ability of html etc, so I would really appreciate some advice on what would be the easiest way of doing something like this - Drupal? JQuery? I have tried searching online for tutorials but I am getting hundreds of different answers using different solutions and would really appreciate your opinions on how to do this in the easiest possible way.

Many thanks in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

万劫不复 2024-10-13 02:18:13

只需选择您的网络托管支持的脚本语言的教程即可。 PHP 非常常见: http://phpeasystep.com/phptu/6.html

Just pick a tutorial for a scripting language that your web hosting supports. PHP is pretty common: http://phpeasystep.com/phptu/6.html

泪之魂 2024-10-13 02:18:13

我建议您使用服务器端脚本进行登录。

为此,您需要

  • 一个存储用户数据的地方
  • 一个可以验证用户的脚本
    数据。

使用您的主机支持的任何脚本语言。

您可以使用平面文件(文本文件)通过加密来存储用户数据,也可以使用数据库(最好)
您可以编写一个小脚本,当用户登录并在浏览器中设置 cookie 时调用该脚本
在只有登录用户才能查看的页面中,可以添加一小段代码来从cookie中进行验证,如果验证通过,则显示数据或显示仅授权用户之类的内容。

这是一个非常基本的功能,但如果这就是您想要的,那么这应该可以实现。

I would suggest using server side scripting for your login.

For this you would need

  • A place to store user data
  • A script that can validate the user
    data.

Use whatever scripting language your host supports for this.

You can either use a flat file (text file) to store user data by encrypting it in it or you can use a database (best)
You can write a small script that is called when the user logs in and sets the cookie in the browser
In the pages that only logged in users can view, you can add a small piece of code to verify from the cookie, if it validates, display the data or display something like Authorized users only.

This is a very basic functionality but if that is all you want, this should do it.

灰色世界里的红玫瑰 2024-10-13 02:18:13

那么,您需要在服务器上有一个数据库来存储用户名/密码组合。这意味着您需要一些服务器端语言来与数据库交互以检查有效的用户名/密码组合,以及使用服务器端语言来知道何时检查用户名/密码(例如哪个页面)受密码保护)。

如果您使用的是 Windows 服务器,MS Access 通常被认为是数据库的良好起点,但从长远来看,我建议使用 mySQL 或 SQL Server。

对于语言,有很多选择。 ASP、PHP、ColdFusion 等。我是一个 ColdFusion 人,所以带着隐含的偏见来看待这个问题,但我认为 CF 对于初学者来说是最容易学习的。

Well, you'd need a database on the server to store the username/password combinations. That means you'd need some server side language to interact with the database to check for valid username/password combinations, as well as using the server side language to know -when- to check for username/pw (e.g. which page(s) are password protected).

If you're on a Windows server, MS Access is generally considered to be a good starting point for database, but I'd recommend mySQL or SQL Server for the long run.

For language, there's a ton to choose from. ASP, PHP, ColdFusion, etc. I'm a ColdFusion person, so take this with the bias that implies , but I think CF is the easiest for a beginner to learn.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文