Clearing the "form submit" cache: how?

Clearing the "form submit" cache: how?

am 18.11.2007 03:56:07 von axlq

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

Re: Clearing the "form submit" cache: how?

am 18.11.2007 04:14:25 von zeldorblat

On Nov 17, 9:56 pm, a...@spamcop.net (axlq) wrote:
> 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

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.

Re: Clearing the "form submit" cache: how?

am 18.11.2007 04:42:04 von axlq

In article ,
ZeldorBlat 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

Re: Clearing the "form submit" cache: how?

am 18.11.2007 06:22:31 von zeldorblat

On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
> In article ,
>
> ZeldorBlat 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?

Re: Clearing the "form submit" cache: how?

am 18.11.2007 07:17:58 von axlq

In article <3e8391a8-b8f6-4e92-a6c6-ab508f1aa32e@b36g2000hsa.googlegroups.com>,
ZeldorBlat wrote:
>On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
>> In article ,
>>
>> ZeldorBlat 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

Re: Clearing the "form submit" cache: how?

am 18.11.2007 19:14:01 von get

In article <3e8391a8-b8f6-4e92-a6c6-
ab508f1aa32e@b36g2000hsa.googlegroups.com>, zeldorblat@gmail.com says...
> On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
> > In article ,
> >
> > ZeldorBlat 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.

Re: Clearing the "form submit" cache: how?

am 18.11.2007 22:01:00 von Michael Fesser

..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

Re: Clearing the "form submit" cache: how?

am 18.11.2007 22:27:22 von Jerry Stuckle

get@alife.com wrote:
> In article <3e8391a8-b8f6-4e92-a6c6-
> ab508f1aa32e@b36g2000hsa.googlegroups.com>, zeldorblat@gmail.com says...
>> On Nov 17, 10:42 pm, a...@spamcop.net (axlq) wrote:
>>> In article ,
>>>
>>> ZeldorBlat 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.
>

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.
jstucklex@attglobal.net
==================

Re: Clearing the "form submit" cache: how?

am 18.11.2007 22:45:37 von John Dunlop

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

Re: Clearing the "form submit" cache: how?

am 20.11.2007 04:35:39 von axlq

In article ,
Jerry Stuckle 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

Re: Clearing the "form submit" cache: how?

am 20.11.2007 04:38:07 von axlq

In article <494e8a99-2220-449a-bcd5-c017fa1c0110@i37g2000hsd.googlegroups.com>,
John Dunlop wrote:
>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

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

Re: Clearing the "form submit" cache: how?

am 20.11.2007 04:40:33 von Jerry Stuckle

axlq wrote:
> In article ,
> Jerry Stuckle 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
>

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.

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

Re: Clearing the "form submit" cache: how?

am 20.11.2007 11:06:57 von John Dunlop

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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 04:24:17 von axlq

In article <1NmdnY89QpChyt_anZ2dnUVZ_uiknZ2d@comcast.com>,
Jerry Stuckle 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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 04:25:34 von axlq

In article <12c916cb-9ce4-40e3-a1ce-065f1f94f40d@b36g2000hsa.googlegroups.com>,
John Dunlop wrote:
>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?

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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 05:40:21 von Jerry Stuckle

axlq wrote:
> In article <1NmdnY89QpChyt_anZ2dnUVZ_uiknZ2d@comcast.com>,
> Jerry Stuckle 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
>



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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 10:13:41 von John Dunlop

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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 11:10:21 von luiheidsgoeroe

On Wed, 21 Nov 2007 10:13:41 +0100, John Dunlop wrote:

> 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

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

Re: Clearing the "form submit" cache: how?

am 21.11.2007 12:10:33 von John Dunlop

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

Re: Clearing the "form submit" cache: how?

am 22.11.2007 05:12:23 von axlq

In article ,
John Dunlop wrote:
>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

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