在php中创建唯一的投票/投票/调查 [英] Create unique Poll/vote/survey in php

查看:86
本文介绍了在php中创建唯一的投票/投票/调查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的意思是唯一的投票/投票/调查,用户只能投票一次.我怎么做?追踪他们的IP?登录?除了登录,还有什么? (登录是我的最后选择,因此除了登录外,我还能做其他事情吗?)

The unique poll/vote/survey i mean here is, user can only vote once. How do i do that? Track their ip? Login? Beside login, what else? (login is my last option, thus beside login, is there anything else I can do?)

推荐答案

要限制每人的投票数,您需要跟踪该人.

To restrict the number of votes per person, you need to track the person.

现在有多种方法可以做到这一点,我将列出它们的优缺点.由您决定哪种方法最适合您.

Now there can be several ways to do that, and I'll list them with their pros and cons. Its for you to decide which method suits you best.

  1. 登录:这将为您提供最终的控制权.但是对于用户来说也有点麻烦. 并且是您的最后选择
  2. IP:您将如何处理网络代理背后的人员?拥有拨号连接和/或动态IP的人怎么样?
  3. cookies:这对短期民意调查很有用,因此您可以将cookie的到期时间设置为民意调查结束的时间.但是,潜在的缺点是用户(与 luser 相比)会知道如何删除饼干!
  4. openId :尽管此方法与'login'方法没有太大不同,但这可以使用户免于注册(这实际上是最能激发登录名的部分).
  1. login: this will offer you ultimate control. But its also a little cumbersome for the user. and its your last preference
  2. IP: how will you handle people behind web proxies? How about people with dialup connections and/or dynamic IPs?
  3. cookies: this is good for short term polls, so you can set the expiration of cookies to a time when the poll has ended. But, a potential drawback is that a user (contrasted with a luser) will know how to delete the cookies!
  4. openId: While this method is not too different from the 'login' method, this saves the user from registration (which really is the part that sux the most about logins).

这种情况下的问题是,您需要解决用户的身份.我认为 OpenID 做得很好.

the problem with this situation is that you need to resolve the identity of the user. I think OpenID does this pretty darn well.

干杯

jrh.

这篇关于在php中创建唯一的投票/投票/调查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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