Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Need A Cookie
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Need A Cookie

 Post Reply Post Reply
Author
Susan0722 View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Susan0722 Quote  Post ReplyReply Direct Link To This Post Topic: Need A Cookie
    Posted: 08 June 2004 at 10:52pm
I am so new to this asp stuff and I am really in need of a cookie code to add to a form I have.

I want to restrict users to filling in the form only once as this is a vote for a contest. I only want people to be able to vote once.
After they hit submit they will see a confirmation page listing thier votes. But if they go back to the form and try to vote (hit submit) again, I would like them to be directed to a page that tells them they have already voted.

Someone please help, I don't know how to write this stuff, and don't even know where to put it for that matter.

I created the form in Frontpage and it is connected to a .mdb Access 2000 database. The database is collecting the ip addresses so if the code could be to exclude ip address that would be great.

Here's the link to the page I need to put it in. http://www.horseplaycentral.com/PHn...s2004voting.asp

Thank you so much in advance, I don't have time to read a tutorial I just need someone out of the kindness of their heart to post a simple script that will do what I need it to and tell me where I am suppose to copy and paste it to. Thanks!
Pay for your copy of WebWIZ, it's worth it and you know it!
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 08 June 2004 at 11:39pm
To write a cookie use
Response.Cookies("CookieName")("PollID") = True
and to read a cookie use
Request.Cookies("CookieName")("PollID")

So you will need somting like

If Request.Cookies("CookieName")("PollID") Then
    'User cannot vote
Else
    'User can vote
End If

It is bit hard to tell you were to exacly put it without seeing the code.
Check out http://webwiz.net/asp/sample_scripts/weekly_poll_script .asp

It has the feature you want so it just a matter of viewing how borg has done it and copy that system.

Back to Top
Semikolon View Drop Down
Senior Member
Senior Member


Joined: 09 September 2003
Location: Norway
Status: Offline
Points: 1718
Post Options Post Options   Thanks (0) Thanks(0)   Quote Semikolon Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2004 at 3:46pm
doing IP blocking is in most cases not necessary, as dialup, and some broadband users get a new IP every time they connect to the internet. then they can jst reconnect and vote again, and some other users will get their IP and will be unable to vote.

but there are no ways it is possible to restrict votes to one per user..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2004 at 3:51pm
The best way IMHO is to force the user to be logged in and only allow 1 vote per account, and requiring account activation via. email
Back to Top
Susan0722 View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Status: Offline
Points: 238
Post Options Post Options   Thanks (0) Thanks(0)   Quote Susan0722 Quote  Post ReplyReply Direct Link To This Post Posted: 09 June 2004 at 4:24pm

Semi, there must be away, how about checking the email address?  I realize some folks can take advantage of the system, so I guess I am just keeping the honest folk honest.

Mart, It's to late for me to run this out of my forum, as the voting has already started.  The votes go into a database, I can see the ip addresses and the email addresses that are entered.

So I suppose I will have to sort the votes by hand.

I think Phat is on to something here, and I had another code sent to me by someone on another board.  But I am not sure where to put it.

This is it:  

<%
'-- set the cookie
response.cookies("completedForm") = true

'-- read the cookie
varFormStatus = request.cookies("completedForm")
%>

 

Pay for your copy of WebWIZ, it's worth it and you know it!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.