Sep 13 2006

Uniqueness schemes

Posted by admin under Old ASP applications

Pollmentor stores each vote in a database table (votelog). The poll_id (always current btw - can't vote on an inactive poll) and the voters IP are saved.

Just one vote per 24 hour is allowed per unique IP address, so before voting the system checks to see if there are any votes from this IP, on the particular poll in that table (max 24 hours old record). This might be ok with you, or maybe not.

If you want to implement another scheme - then incpollmentor.asp is the place. Look up the function PollMentor_CanUserVote. There's the code. One alternative scheme might be checking (and setting) a persistant cookie (since multiple people can share the same ip).

However that's up to you, and if you want to change the 24 hours, look for the dateadd:

 



	'1. Check IP address
	Dim strSQL, sTime, oRS
	
	If PollMentor_GetDatabaseType = "SQLServer" Then
		sTime = " dateadd(day,-1,getdate()) "
	Else
			sTime = "#" & DateAdd( "d", -1, Now() ) & "#"
	End If

By changing the -1 to, -365, you will have one year instead of 24 hours.