Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 27th, 2006, 09:25 AM
thehuby
Guest
 
Posts: n/a
Default Back Button POST Issue

Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)

Thanks,

Rick

  #2  
Old January 27th, 2006, 04:05 PM
Jon
Guest
 
Posts: n/a
Default Re: Back Button POST Issue

There isn't a true way too that I know. You could always disable the back
button with JS, but that's usually really annoying for users. I usually
write code against the condition. What I'll do is come up with the scenario
on every page that posts info (in particular inserting of records to a DB)
and ask 'what if the user clicks refresh or back'. Think about the queries,
and write some validation that ensures if they do happen to hit back, AND
they ignore the warning that a browser will throw, it won't matter anyways.
Sometimes it's difficult to write, but usually it's not a big deal.

If there is a way to disable POST data on a refresh, I'd love to know how
though :)

"thehuby" <thehuby@gmail.com> wrote in message
news:1138352953.363521.10320@f14g2000cwb.googlegro ups.com...[color=blue]
> Is there any way of disabling the repost of information when a user
> hits the back button?
>
> Is the only way to do this to actually use some sort of redirect on the
> page receiving the initial post (though this won't stop them hitting
> back twice and possibly reposting will it?)
>
> Thanks,
>
> Rick
>[/color]


  #3  
Old January 27th, 2006, 04:35 PM
Chung Leong
Guest
 
Posts: n/a
Default Re: Back Button POST Issue


thehuby wrote:[color=blue]
> Is there any way of disabling the repost of information when a user
> hits the back button?
>
> Is the only way to do this to actually use some sort of redirect on the
> page receiving the initial post (though this won't stop them hitting
> back twice and possibly reposting will it?)[/color]

That's the way to do it. A browser will only put actual pages into the
history. A POST that doesn't not produce a page, but instead, redirects
to a GET for presentation will not cause the repost warning. And if the
new URL matches exactly that of the page containing the form, the
browser (IE at least), will treat it as though the user has not left
the page at all.

  #4  
Old January 27th, 2006, 04:55 PM
d
Guest
 
Posts: n/a
Default Re: Back Button POST Issue

"Chung Leong" <chernyshevsky@hotmail.com> wrote in message
news:1138379070.567367.199370@g14g2000cwa.googlegr oups.com...[color=blue]
>
> thehuby wrote:[color=green]
>> Is there any way of disabling the repost of information when a user
>> hits the back button?
>>
>> Is the only way to do this to actually use some sort of redirect on the
>> page receiving the initial post (though this won't stop them hitting
>> back twice and possibly reposting will it?)[/color]
>
> That's the way to do it. A browser will only put actual pages into the
> history. A POST that doesn't not produce a page, but instead, redirects
> to a GET for presentation will not cause the repost warning. And if the
> new URL matches exactly that of the page containing the form, the
> browser (IE at least), will treat it as though the user has not left
> the page at all.[/color]

Exactly. I use this technique all the time, and it works fine on every
browser I've tested it on.


  #5  
Old January 27th, 2006, 05:45 PM
Jon
Guest
 
Posts: n/a
Default Re: Back Button POST Issue

Awesome - thanks for the algorithm guys - this will save me a bit of time
with validation :)

"d" <d@example.com> wrote in message
news:Q7sCf.10254$wl.6393@text.news.blueyonder.co.u k...[color=blue]
> "Chung Leong" <chernyshevsky@hotmail.com> wrote in message
> news:1138379070.567367.199370@g14g2000cwa.googlegr oups.com...[color=green]
>>
>> thehuby wrote:[color=darkred]
>>> Is there any way of disabling the repost of information when a user
>>> hits the back button?
>>>
>>> Is the only way to do this to actually use some sort of redirect on the
>>> page receiving the initial post (though this won't stop them hitting
>>> back twice and possibly reposting will it?)[/color]
>>
>> That's the way to do it. A browser will only put actual pages into the
>> history. A POST that doesn't not produce a page, but instead, redirects
>> to a GET for presentation will not cause the repost warning. And if the
>> new URL matches exactly that of the page containing the form, the
>> browser (IE at least), will treat it as though the user has not left
>> the page at all.[/color]
>
> Exactly. I use this technique all the time, and it works fine on every
> browser I've tested it on.
>[/color]


 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles