Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-18-2002, 06:47 AM   PM User | #1
The Wizzard
Regular Coder

 
Join Date: Jun 2002
Location: Lake Forest, CA
Posts: 259
Thanks: 0
Thanked 0 Times in 0 Posts
The Wizzard is an unknown quantity at this point
Cookies & Forms

Hi, what i need to do is create a form for users to send information to me, but once they have submitted this form, they cannot submit the form again.

Thanks!
The Wizzard is offline   Reply With Quote
Old 07-18-2002, 01:48 PM   PM User | #2
allida77
Regular Coder

 
Join Date: Jun 2002
Location: Cincinnati, OH
Posts: 545
Thanks: 0
Thanked 0 Times in 0 Posts
allida77 is an unknown quantity at this point
I dont think you need to use a cookie, javascript should be able to handle it

<script language='javascript'>
var submitted=0;
function validateForm()
{
if (submitted==0)
{
document.testForm.submit();
submitted=1;
}
}
</script>
allida77 is offline   Reply With Quote
Old 07-18-2002, 07:01 PM   PM User | #3
The Wizzard
Regular Coder

 
Join Date: Jun 2002
Location: Lake Forest, CA
Posts: 259
Thanks: 0
Thanked 0 Times in 0 Posts
The Wizzard is an unknown quantity at this point
Ya, but i dont want them to be able to re-submit EVER again... What this is, is an enlistment form for a game, and people will be able to send in there info and hope to be recruited, but i dont want someone spamming there info, or just crap info.

Thanks
The Wizzard is offline   Reply With Quote
Old 07-18-2002, 08:04 PM   PM User | #4
allida77
Regular Coder

 
Join Date: Jun 2002
Location: Cincinnati, OH
Posts: 545
Thanks: 0
Thanked 0 Times in 0 Posts
allida77 is an unknown quantity at this point
If you are wanting to set a cookie than if they delete cookies than they can submit the form. You can set a field into your db by capturing their IP or email. On your form page do something like:

for cookie:
whatever page the form action is sent to on the bottom put:

Response.Cookie("frmSubmitted") = "True"

on the top of your form page:

If Response.Cookie("frmSubmitted") = "True" Then
Response.Redirect "default.asp"
End If

Doing it like this they will always be redirected if their cookie is set. Using a db would be the same concept.
allida77 is offline   Reply With Quote
Old 07-18-2002, 09:39 PM   PM User | #5
oracleguy
Rockstar Coder


 
Join Date: Jun 2002
Location: USA
Posts: 9,043
Thanks: 1
Thanked 322 Times in 318 Posts
oracleguy is a jewel in the roughoracleguy is a jewel in the roughoracleguy is a jewel in the rough
Either of those ideas have pros and cons:

Cookies:
Pros-
  • Fast
  • Efficent
Cons-
  • If cookies are disabled, doesn't work.
  • IE6 have issues taking unsigned cookies
  • They can just be deleted
Database:
Pros-
  • Solves the problems cookies have
  • Much harder for people to resubmit
Cons-
  • Uses up server bandwidth and resources
  • If the person is on dial-up they're IP address resets when they re-connect.
I just thought I'd point that out. Perhaps some combination of the two?
oracleguy is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:50 AM.


Advertisement
Log in to turn off these ads.