Viciouse Circle !

M

Mel Smith

Hi:

Basic Question:

How do I stop multiple 'Submits'

Explanation:

My futures users will Submit a form. When this form is 'accepted' on my
server, and when it is 'Confirmed' and validated on my server, and when it
is saved away on a server database, then I *don't want* my users to
re-submit the *same* form by accident (e.g., if they use the Back Button to
return to the 'Submit' screen and then press the 'Submit Button' again, I
get into a vicious circle of Submit, Confirm, and Save Away).

How can I thwart this multiple submit cycle please ??

Thanks for any thoughts.
 
J

Jonathan N. Little

Mel said:
Hi:

Basic Question:

How do I stop multiple 'Submits'

Explanation:

My futures users will Submit a form. When this form is 'accepted' on my
server, and when it is 'Confirmed' and validated on my server, and when it
is saved away on a server database, then I *don't want* my users to
re-submit the *same* form by accident (e.g., if they use the Back Button to
return to the 'Submit' screen and then press the 'Submit Button' again, I
get into a vicious circle of Submit, Confirm, and Save Away).

How can I thwart this multiple submit cycle please ??

Thanks for any thoughts.

<http://lmgtfy.com?q=php+prevent+multiple+submissions>
 
M

Mel Smith

Jonathan:

I tried the technique of disabling the 'Submit' Button and changing its
value to 'Already Submitted' -- during the Validate sequence.

However, when the user hits the back buton to the original version of
the 'submit' page, he sees the submit button *enabled* again with the
original value.

So, I guess there's no way I can alter the historical version of this
page in his cache ??

I guess what I have to do is check for a complete duplicate in the input
form before adding the info from this re-sent page to my database. Damn !

Anyway, Thank You for the link suggestions.

-Mel Smith
 
J

Jonathan N. Little

Mel said:
Jonathan:


I tried the technique of disabling the 'Submit' Button and changing its
value to 'Already Submitted' -- during the Validate sequence.

Not the JavaScript part. JavaScript can always be circumvented. Focus on
the PHP part and a session cookie.
 
M

Mel Smith

Jonathan said
Not the JavaScript part. JavaScript can always be circumvented. Focus on
the PHP part and a session cookie.

Altho I used a c++ proggie as aa cgi script, I have successfully modified my
program to tell the user he attempted to duplicate his previous submission.

It seems to work !

Thank you

-Mel
 
R

Raymond Schmit

Jonathan said


Altho I used a c++ proggie as aa cgi script, I have successfully modified my
program to tell the user he attempted to duplicate his previous submission.

It seems to work !
That's the best way of doing it - avoiding an identical post.
 
R

rf

Mel Smith said:
Jonathan:


I tried the technique of disabling the 'Submit' Button and changing its
value to 'Already Submitted' -- during the Validate sequence.

However, when the user hits the back buton to the original version of
the 'submit' page, he sees the submit button *enabled* again with the
original value.

When the form is submitted and the input processed cause your server side
script to redirect, using a Location: header, to the same page (with all the
input fields blank of course). That way there is no "back" page in the
browsers history with those input fields filled in, so there is no chance of
a duplicate submit. And you never get that annoying question about
re-submitting the form information again.
So, I guess there's no way I can alter the historical version of this
page in his cache ??

Yes there is. See above.
I guess what I have to do is check for a complete duplicate in the
input form before adding the info from this re-sent page to my database.
Damn !

Probably a good idea anyway, the user just might fill in exactly the same
information a second time.
 
M

Mel Smith

RF said:
When the form is submitted and the input processed cause your server side
script to redirect, using a Location: header, to the same page (with all
the input fields blank of course). That way there is no "back" page in the
browsers history with those input fields filled in, so there is no chance
of a duplicate submit. And you never get that annoying question about
re-submitting the form information again.


Yes there is. See above.


Probably a good idea anyway, the user just might fill in exactly the same
information a second time.

rf:
Thanks for the *further* guidance/suggestion above. I'll mull on it over
the next few days.

-Mel
 
W

William Gill

When the form is submitted and the input processed cause your server side
script to redirect, using a Location: header, to the same page (with all the
input fields blank of course). That way there is no "back" page in the
browsers history with those input fields filled in, so there is no chance of
a duplicate submit. And you never get that annoying question about
re-submitting the form information again.

Being presented with the original (blank) form, many users will assume
they or the program reset the form, and dutifully refill and resubmit it
at least one more time.

I usually redirect them to a confirmation ("Thank you we'll get back to
you...") screen. In PHP this can be done by making the script the
target of the form's action, and performing an if test for the submit
variable to determine whether to output the form or the thank you.

I haven't played with it, but I would think a session variable could be
similarly used to address back button issues. i.e. set a session
variable with a time-stamp when originally submitted and testing to see
if the resubmit is delayed sufficiently to indicate an intentional
resubmission (correction?).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top