
25/11/2006, 09:05
|
 | | | Fecha de Ingreso: diciembre-2005 Ubicación: Argentina
Mensajes: 383
Antigüedad: 19 años, 3 meses Puntos: 7 | |
Podrías hacer algo así:
Código:
' Esta es la cantidad de voto que puede enviar por día
ngSubmitLimit = 1
Function validateSubmitLimit
sAddress = Request.ServerVariables("REMOTE_ADDR")
dYesterday = DateAdd("D", -1, DATE())
Set rSelect = Server.CreateObject("ADODB.Recordset")
sSQL = "SELECT count(*) FROM [Votos]" _
& " WHERE [IpAddress] = '" & sAddress & "'" _
& " AND [Timestamp] > #" & dYesterday & "#"
rSelect.Open sSQL, ogConn
If bgDebug Then
ogDebug.WriteLine(sSQL)
ogDebug.WriteLine("Count = " & rSelect.Fields(0))
End If
If rSelect.Fields(0) < ngSubmitLimit Then
validateSubmitLimit = True
Else
sgError = "Ya has Votado." _
& " Por favor vuelve a votar otro día."
validateSubmitLimit = False
End If
set rSelect = Nothing
End Function
Espero que te sirva 
Saludos! EDITO: Este ejemplo funciona con la ip del usuario, entonces de esta forma, guardando en una BD el ip y la fecha en que voto hace los calculos para saber si puede o no votar nuevamente.
__________________ I'm gonna start a revolution from my bed...
Última edición por pablinff; 25/11/2006 a las 18:06
Razón: Agrego Info.
|