多个用户登录&密码 [英] Multiple users login & password

查看:49
本文介绍了多个用户登录&密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的ev1,


我相信用于登录多个用户的服务器端脚本是最佳解决方案。我在Web上看到了很多用户登录的javascripts。但是,我还没有看到PHP脚本。有人能指点我一个吗? (我还在冲浪。如果有人能引导我去,我会很感激。)


此外,脚本是一个简单的文件保存类型的脚本还是这需要一个数据库吗?请指教。


最后,我会感谢大师的任何建议。呵呵......


REY

Dear ev1,

I believe that a server side script for log-in of multiple users is the best solution. I see a lot of javascripts for multiple user log-in in the web. But, I haven''t seen a PHP script on that. Can anyone point me to one, please? (I''m still surfing. If anyone can lead me to one, I''d appreciate it.)

Also, will the script be a simple file saving type of script or would a database be required for this? Please advise.

Lastly, I''d appreciate any advise from the gurus. Hehe...

REY

推荐答案

@rsbgm


最安全的解决方案是将登录数据(即登录名和密码的哈希值)保存在数据库中,因为DB最不容易从外部访问。


in PHP a登录系统通常(总是?)由会话处理。
@rsbgm
the most secure solution is to save the login data (i.e. login name and hash value of the password) in a database, because a DB is least accessable from outside.

in PHP a login system is often (always?) handled by sessions.


你是正确的方式。 PHP是会话和数据库访问的最佳语言。您需要做的就是创建一个至少包含2列(名称和密码)的数据库表。但我建议至少3,每个表的id在长期运行中非常方便,甚至更好4,用于不同的用户访问权限。


代码的关键部分看起来像这个。

You are on the right way. PHP is the best language for sessions and database access. All you need to do is create 1 database table with at least 2 columns (name and password). But I recommend at least 3, id at every table is very handy in long run or even better 4, for different user access rights.

Key parts of the code will look like something like this.

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


@secmazec


数组键,除非它们是整数或常量,应该用单引号或双引号括起来。


rsbgm,多用户登录是什么意思?多个用户从同一台计算机登录...?或者您是在谈论像Bytes.com自己的用户注册系统?
@secmazec
Array keys, unless they''re integers or constants, should be wrapped with single or double quotes.

rsbgm, what do you mean by ''multiple user logon''? Multiple users logging on from the same computer... ? Or are you speaking of a user registration system like Bytes.com''s own?


这篇关于多个用户登录&amp;密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆