Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clearing the "form submit" cache: how?

322 views
Skip to first unread message

axlq

unread,
Nov 17, 2007, 9:56:07 PM11/17/07
to
Situation: User submits a form, gets a page returned. User clicks
the "reload button."

Normal result: Browser asks to confirm re-submitting of the form
data.

That's not what I want. What I want is behavior like what Wikipedia
does, as well as vBulletin forums and other nice php-based sites:

Situation: User submits a form, gets a page returned. User clicks
the "reload button."

Desired Result: The current page simply re-loads and the user isn't
asked to confirm re-submission of the form data. The form data
isn't re-submitted.

This may not be a php problem, but I tend to notice this on php
sites because my php site doesn't exhibit this behavior, and I want
it to. How do I accomplish this?

-A

ZeldorBlat

unread,
Nov 17, 2007, 10:14:25 PM11/17/07
to

This question has been asked and answered many times in this
newsgroup. With a little bit of searching you should be able to find
it.

axlq

unread,
Nov 17, 2007, 10:42:04 PM11/17/07
to
In article <ae57203b-6781-4068...@e1g2000hsh.googlegroups.com>,

ZeldorBlat <zeldo...@gmail.com> wrote:
>On Nov 17, 9:56 pm, a...@spamcop.net (axlq) wrote:
>> Desired Result: The current page simply re-loads and the user isn't
>> asked to confirm re-submission of the form data. The form data
>> isn't re-submitted.
>
>This question has been asked and answered many times in this newsgroup.

No, not really, as far as I can tell.

>With a little bit of searching you should be able to find it.

Perhaps I am using the wrong terminology in my search. All I find
are articles about form data being lost, not on intentionally losing
it.

-A

ZeldorBlat

unread,
Nov 18, 2007, 12:22:31 AM11/18/07
to
On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
> In article <ae57203b-6781-4068-b1b6-9317e3549...@e1g2000hsh.googlegroups.com>,

>
> ZeldorBlat <zeldorb...@gmail.com> wrote:
>
> >With a little bit of searching you should be able to find it.
>
> Perhaps I am using the wrong terminology in my search. All I find
> are articles about form data being lost, not on intentionally losing
> it.
>
> -A

Perhaps "form double post" or "form double submission" would work?

axlq

unread,
Nov 18, 2007, 1:17:58 AM11/18/07
to
In article <3e8391a8-b8f6-4e92...@b36g2000hsa.googlegroups.com>,

ZeldorBlat <zeldo...@gmail.com> wrote:
>On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
>> In article <ae57203b-6781-4068-b1b6-9317e3549...@e1g2000hsh.googlegroups.com>,
>>
>> ZeldorBlat <zeldorb...@gmail.com> wrote:
>>
>> >With a little bit of searching you should be able to find it.
>>
>> Perhaps I am using the wrong terminology in my search. All I find
>> are articles about form data being lost, not on intentionally losing
>> it.
>
>Perhaps "form double post" or "form double submission" would work?

Ah. Yes, thanks.

MY searches only turned up non-useful information (and eventually my
original posting). For searches by others in the future:

Apparently the trick is to separate the form processing URL from the
output URL. That is, have the form on page1.php execute page2.php,
which does processing but no output, and then use header("Location:
page3.php") to redirect to the result page that actually does
output. Then, refreshing page3.php will simply refresh the page
without re-submitting the form on page1.php.

-A

g...@alife.com

unread,
Nov 18, 2007, 1:14:01 PM11/18/07
to
In article <3e8391a8-b8f6-4e92-a6c6-
ab508f...@b36g2000hsa.googlegroups.com>, zeldo...@gmail.com says...

> On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
> > In article <ae57203b-6781-4068-b1b6-9317e3549...@e1g2000hsh.googlegroups.com>,
> >
> > ZeldorBlat <zeldorb...@gmail.com> wrote:
> >
> > >With a little bit of searching you should be able to find it.

> > -A


>
> Perhaps "form double post" or "form double submission" would work?
>

perhaps if you just answered the damned question instead of being an arse
it would save us all some time.

Michael Fesser

unread,
Nov 18, 2007, 4:01:00 PM11/18/07
to
.oO(axlq)

>Apparently the trick is to separate the form processing URL from the
>output URL.

No, it can all be done on a single page. After the form processing send
a Location header with the absolute URL of the current page back to the
browser - that's it. The following GET request will replace the previous
POST in the browser history, so a reload won't re-submit the form data.

Micha

Jerry Stuckle

unread,
Nov 18, 2007, 4:27:22 PM11/18/07
to

And maybe he gets tired of answering the same question because you and
others like you are too lazy to search for the answer. Even typing an
asinine post like yours takes more time than searching for the correct
answer.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

John Dunlop

unread,
Nov 18, 2007, 4:45:37 PM11/18/07
to
axlq:

> Situation: User submits a form, gets a page returned. User clicks
> the "reload button."
>
> Desired Result: The current page simply re-loads and the user isn't
> asked to confirm re-submission of the form data. The form data
> isn't re-submitted.

Without a URL I can't tell, but I have a suspicion you are using the
POST method instead of the GET method. User-agents should make their
users aware if their actions are non-idempotent.

http://www.w3.org/2001/tag/doc/whenToUseGet.html

--
Jock

axlq

unread,
Nov 19, 2007, 10:35:39 PM11/19/07
to
In article <xdmdnXffneLYM93a...@comcast.com>,

Jerry Stuckle <jstu...@attglobal.net> wrote:
>> perhaps if you just answered the damned question instead of being an arse
>> it would save us all some time.
>
>And maybe he gets tired of answering the same question because you and
>others like you are too lazy to search for the answer. Even typing an
>asinine post like yours takes more time than searching for the correct
>answer.

I've been on usenet over 20 years. I know enough to search for
an answer before I post, and I also know to expect a few arrogant
replies from the less experienced usenetters who think they have
answered all the questions already. The only reason I posted the
question in the first place was, OBVIOUSLY, that I didn't find
the answer in spite of my searches. The reason was that I wasn't
searching for the proper terms.

-A

axlq

unread,
Nov 19, 2007, 10:38:07 PM11/19/07
to
In article <494e8a99-2220-449a...@i37g2000hsd.googlegroups.com>,

Well, yes. The words "resubmission of *form* data" should have made
it clear that I'm referring to POST, not GET.

Anyway, the rest of this thread contains the answer I was looking for.
Thanks.

-A

Jerry Stuckle

unread,
Nov 19, 2007, 10:40:33 PM11/19/07
to

If you've been on usenet over 20 years as you claim, then you should
have been able to figure out the search words to use.

I've been on a lot longer than you - stretching back to the arpanet days
in the early 70's. And I know there are always a few arrogant
usenetters who think that since they've been on for X number of years
they don't need to do their own homework.

John Dunlop

unread,
Nov 20, 2007, 5:06:57 AM11/20/07
to
axlq:

> The words "resubmission of *form* data" should have made
> it clear that I'm referring to POST, not GET.

Which part of "resubmission of form data" do you think excludes GET?

--
Jock

axlq

unread,
Nov 20, 2007, 10:24:17 PM11/20/07
to
In article <1NmdnY89QpChyt_a...@comcast.com>,

Jerry Stuckle <jstu...@attglobal.net> wrote:
>If you've been on usenet over 20 years as you claim, then you should
>have been able to figure out the search words to use.

Ah, but I haven't been doing php that long, or WWW programming, so I'm
not up on the jargon. If you don't know the search terms, your search
is bound to fail.

>I've been on a lot longer than you - stretching back to the arpanet days
>in the early 70's.

I personally doubt that, but I'll grant it.

>And I know there are always a few arrogant
>usenetters who think that since they've been on for X number of years
>they don't need to do their own homework.

Thank heavens I'm not one of them.

-A

axlq

unread,
Nov 20, 2007, 10:25:34 PM11/20/07
to
In article <12c916cb-9ce4-40e3...@b36g2000hsa.googlegroups.com>,

Eh... you're right. I got so into the habit of forms using the POST
method that I forgot you could use GET as well.
-A

Jerry Stuckle

unread,
Nov 20, 2007, 11:40:21 PM11/20/07
to
axlq wrote:
> In article <1NmdnY89QpChyt_a...@comcast.com>,
> Jerry Stuckle <jstu...@attglobal.net> wrote:
>> If you've been on usenet over 20 years as you claim, then you should
>> have been able to figure out the search words to use.
>
> Ah, but I haven't been doing php that long, or WWW programming, so I'm
> not up on the jargon. If you don't know the search terms, your search
> is bound to fail.
>
>> I've been on a lot longer than you - stretching back to the arpanet days
>> in the early 70's.
>
> I personally doubt that, but I'll grant it.
>

I'm older than you think. I've been programming for about 40 years now.
And back in the 70's arpanet was mainly the military and those
associated with the military - i.e. companies and universities doing
military research.

>> And I know there are always a few arrogant
>> usenetters who think that since they've been on for X number of years
>> they don't need to do their own homework.
>
> Thank heavens I'm not one of them.
>
> -A
>

--

John Dunlop

unread,
Nov 21, 2007, 4:13:41 AM11/21/07
to
axlq:

> I got so into the habit of forms using the POST
> method that I forgot you could use GET as well.

If your action does not change a resource (e.g., a database query),
GET would generally be more appropriate.

http://www.w3.org/2001/tag/doc/whenToUseGet.html

--
Jock

Rik Wasmus

unread,
Nov 21, 2007, 5:10:21 AM11/21/07
to

Don't know what's in the link, I always some it up like this:
- GET is for bookmarkable displaying of data.
- POST is for altering data (add/alter/remove), or performing actions
(mailing, document creation, etc.).
--
Rik Wasmus

John Dunlop

unread,
Nov 21, 2007, 6:10:33 AM11/21/07
to
Rik Wasmus:

> [John Dunlop:]


>
> > http://www.w3.org/2001/tag/doc/whenToUseGet.html
>
> Don't know what's in the link, I always some it up like this:
> - GET is for bookmarkable displaying of data.
> - POST is for altering data (add/alter/remove), or performing actions
> (mailing, document creation, etc.).

That's the general idea of the TAG Finding, but they also discuss
sensitive data and practicalities such as i18n and URL length that
also bear on the choice.

--
Jock

axlq

unread,
Nov 21, 2007, 11:12:23 PM11/21/07
to
In article <b0f970ed-a522-4536...@l22g2000hsc.googlegroups.com>,

Thanks. All but one of the form submit actions change a resource on
my site. The one that doesn't has so many variables in it that a
GET string is too unwieldy, so I use POST for that too.

-A

0 new messages