简体   繁体   English

如何使用 mysql 保存用户状态,以便他们每天只能执行一次操作?

[英]How can I use mysql to save user state, so that they can only perform an action once per day?

< button type="button" id="daily-reward-button">Claim< /button> <button type="button" id="daily-reward-button">声明</button>

1)When a User press this Button -> Button gets Disabled (User gets Banned in MYSQL /cannot Press it again) 1)当用户按下此按钮时 -> 按钮被禁用(用户在 MYSQL 中被禁止/不能再次按下它)

2) After day changes at 00:00:01am re-enable it (Unban User in MYSQL) 2)在上午 00:00:01 更改后重新启用它(在 MYSQL 中取消禁止用户)

I want Users not to be able to bypass this restriction by just deleting their cookies etc, that is why I think it must be done in co-operation with MYSQL.我希望用户不能仅仅通过删除他们的 cookie 等来绕过这个限制,这就是为什么我认为它必须与 MYSQL 合作完成。

I am a newbie so any extra information-explanation like im 5 would be much appreciated.我是一个新手,所以任何像 im 5 这样的额外信息解释将不胜感激。

Thank you in advance.先感谢您。

Best Regards,此致,

Chris克里斯

That is A LOT of components working together.那是很多组件一起工作。 User state is going to have to be saved by your front end JavaScript as well as your PHP/SQL backend.用户状态必须由前端 JavaScript 以及 PHP/SQL 后端保存。

What is supposed to happen if the user clicks the browser away?如果用户点击浏览器离开会发生什么? It hasn't to poll the PHP/SQL, and also keep the information in the JavaScript.它没有轮询 PHP/SQL,也将信息保存在 JavaScript 中。

What is supposed to happen if the user changes machines?如果用户更换机器会发生什么? Do you remember his login username?你还记得他的登录用户名吗? Have you implemented usernames and passwords?您是否实施了用户名和密码?

If you just want to disable a button in JavaScript, and not communicate any state to the server, that's one thing (usually 1 or 2 lines of JavaScript), but if you have users, you will need an end to end solution.如果您只想禁用 JavaScript 中的按钮,而不向服务器传达任何状态,那是一回事(通常是 1 或 2 行 JavaScript),但如果您有用户,则需要端到端的解决方案。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何每天一次遍历数组? - How can I iterate through an array once per day? 如何在jtable标题中添加复选框,以便只检查列,我可以根据用户的意愿调用打印? - how to add checkbox in jtable header,so that the checked columns only i can called for print as per the user wish? 如何保存数据persistend,以便我可以离线使用它们 - How to save data persistend so I can use them offline 我该如何仅将每行替换添加一次? - How can I only append only once per line that has a replacement? Android中的列表视图每天只对用户进行一次验证 - Only once per day validation for user from a list view in Android 如何构建一个我每天只能发送 1000 条短信并在 24 小时内重置限制的逻辑 - How to build a logic in which I can send only 1000 sms per day and the limit reset in 24 hrs 如何保存我的Android应用程序,以便最终用户可以在没有Android SDK的情况下执行它 - How can I save my Android application so that the end-user can execute it without the Android SDK 如何从Java保存Open NLP解析器输出,以便我可以在Python中使用它? - How can I save the Open NLP parser output from Java, so that I can use it in Python? 我怎样才能每天限制一个按钮 5 次? - How can i limit a button 5 times per day? 如何使用ActionListener对鼠标释放/鼠标移动执行操作? - How can I use an ActionListener to perform an action on mouse release/mouse up?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM