几次登录尝试 [英] several login attempts

查看:82
本文介绍了几次登录尝试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好我在php的新手..

你可以帮我解决如何在php中进行多次登录尝试吗?

(如果我们输入错误的密码/用户名) ,,我们将返回上一个表单,我们可以再尝试3次输入正确的密码/用户名,然后再显示错误消息)

感谢之前..

hi i''m a newbie in php..
can you help me how to make several login attempt in php?
(if we put wrong password/username,, we will go back to the previous form and we can try 3 more attempts to input the correct password/username before appear an error message)
thanks before..

推荐答案

欢迎使用脚本。


如果我们看不到任何帮助或工作的代码,我们无法帮助您。所以,首先你必须向我们展示你到目前为止所编写的代码。然后我们可以看看如何限制登录次数。


并在相应的代码标签中显示任何代码!


Ronald
Welcome to The Scripts.

We cannot help you if we see no code to help or work on. So, first you''ll have to show us the code you have written so far. Then we can have a look at how to limit the number of logins.

And show any code within the appropriate code tags!

Ronald


抱歉,我没有写代码..

这里是我的代码..


这是form.html
sorry I didn''t write the code..
here''s my code..

this is the form.html
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


嗯。

所以你没有使用一个用于存储登录详细信息的数据库,这可能会使事情变得更难。


这种计算尝试的目的是什么?经过这么多尝试后,用户被阻止登录一段时间吗?


我的意思是,你可以使用会话或cookie,但用户可以删除它们......所以它们不是一个好主意。最好的办法是将用户的IP地址存储在数据库中,但从它的外观来看,你还没有使用MySQL。


我建议你有一个看看一些php / mysql教程 - 从长远来看它会对你有所帮助。


问候,马库斯。
Hmm.
So you aren''t using a database to store log in details, this may make things harder.

What is the purpose of this ''counting of attempts''? Is it so that, after so many tries, the user is blocked from logging in for a certain amount of time?

I mean, you could use sessions, or cookies, but the user could just delete them.. so they''re not a great idea. The best bet would be to store the user''s IP address in a database, but by the looks of it you havent had a go with MySQL yet.

I recommend you have a look at some php/mysql tutorials - it''ll benefit you greatly in the long run.

Regards, markus.


这篇关于几次登录尝试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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