投票/投票系统 [英] voting / polling system

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

问题描述

Hi Folk


我正在开发投票/投票系统。


例如。


谁是你最喜欢的运动明星:

a。迈克

b。 sara

c。 frank


我想确保一个人不能多次投票。


我考虑过使用会话ID一个独特的标识符,你认为是什么?b $ b想想什么?


TIA


- Nicolaas

解决方案

2005年9月3日星期六12:35:30 +1200,windandwaves写道:

我考虑过使用会话ID作为唯一标识符,您认为是什么?




您应该只允许注册用户投票或创建
$ b带有setcookie()的$ b cookie,如果设置了相应的


_COOKIE,则拒绝投票。当然,没有任何东西可以阻止用户在浏览器中清除cookie或通过LWP投票,这将给用户

完全控制他的cookie和奶油。

这是只允许注册用户投票的好处。我必须承认,我曾经使用Perl和LWP进行了一次民意调查,并且获胜选项赢得的票数是可能的票数的100倍。 />
选民。当然,民意调查是基于cookie的。如果您的目标是发现隐藏的Perl编程天赋,那么基于cookie的民意调查就是您的选择。如果,另一方面,你需要一个真实的民意调查,那么你可以只允许注册用户投票

并将投票记录插入数据库

表,用户名作为主键。主键不允许重复,

因此,提前投票和经常投票的尝试将不可避免地失败。那个

意味着一切都是服务器控制的,并且没有留下任何东西用于在客户端练习脚本技能。这种类型的民意调查是无聊和现实的。


-
http://www.mgogala.com


Mladen Gogala写道:

2005年9月3日星期六12:35:30 +1200,windandwaves写道:

我想过使用会话ID作为唯一标识符,做什么?您认为?



您应该只允许注册用户投票或使用setcookie()创建一个cookie,如果
则拒绝允许投票相应


Hi Folk

I am developing a voting / polling system.

Eg.

Who is your favourite sport star:
a. mike
b. sara
c. frank

and I want to make sure that one person can not vote more than one time.

I thought about using the session ID as a unique identifier, what do you
think?

TIA

- Nicolaas

解决方案

On Sat, 03 Sep 2005 12:35:30 +1200, windandwaves wrote:

I thought about using the session ID as a unique identifier, what do you
think?



You should either allow voting only to the registered users or create a
cookie with setcookie() and refuse to allow voting if the corresponding


_COOKIE is set. Of course, nothing will prevent the user from cleaning
the cookies in his browser or voting by LWP, which will give the user
the full control over his cookies and cream.
That is the benefit of allowing only registered users to vote. I have to
confess that I once rigged a poll like that using Perl and LWP and that
the winning option won with 100 times as many votes as there were possible
voters. Of course, the poll was cookie based. If your goal is to discover
hidden Perl programming talents, cookie-based polls are the way to go. If,
on the other hand, you want a realistic poll, then you can allow voting
only to the registered users and insert the voting record into a database
table with username as the primary key. Primary key disallows duplicates,
so an attempt to vote early and vote often will inevitably fail. That
means that everything is server controlled and nothing is left for
practicing scripting skills on the client side. That type of polls is
boring and realistic.

--
http://www.mgogala.com


Mladen Gogala wrote:

On Sat, 03 Sep 2005 12:35:30 +1200, windandwaves wrote:

I thought about using the session ID as a unique identifier, what do
you think?



You should either allow voting only to the registered users or create
a cookie with setcookie() and refuse to allow voting if the
corresponding


这篇关于投票/投票系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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