Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need advise on how to circumvent error with forms and back button


NodsDorf

Recommended Posts

We have a form on our OSC website that helps users find specific products. It was designed so that you can filter selections based off given parameters. When you have filtered as far as you like you just hit the update button and the products matching the parameters the users selects are displayed.

 

Now if you hit the Browser "BACK" button like many people do you get this error in firefox

Error

-To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.

 

You get this in IE 8

Error

-Webpage has expired

 

You get this in Chrome

Error

-Confirm Form Resubmission

 

Here is a link to to the form (just make a few selection then hit the Update button on the form, then use the browsers back button to duplicate)

http://www.rubbersto...duct-search.php

 

I've been researching the issue and I found one post on an ASP forum that says they can fix it by using this code

protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
{
	if (e.Exception != null)
	{
	this.lblErrorMessage.Text = e.Exception.Message;
	}
	else
	{
	Response.Redirect(Request.Url.ToString(), false);
	}
}
[/url][size="2"]

Ref: http://forums.asp.net/t/1335572.aspx

 

Is there any way to prevent this for happening with php, it is kind of a major annoyance to our users.

Link to comment
Share on other sites

Most of the help I've seen on the web has to do with how to prevent it from happening locally, not how to stop it from happening server side.

 

Again any help is very much appreciated.

 

Thanks,

Don

Link to comment
Share on other sites

  • 4 weeks later...

Anybody have any thoughts. Any help would be appreciated.

 

Thank you,

Don

 

Hate to Revive this post but it's my next bug to squish, and I'm still at a complete loss after hours of searching.

Link to comment
Share on other sites

Hate to Revive this post but it's my next bug to squish, and I'm still at a complete loss after hours of searching.

I found this

 

Maybe it will help, maybe not. I haven't really looked at it in detail.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Link to comment
Share on other sites

  • 2 weeks later...

This was a royal pain.

 

Thankfully I found a solution.

 

Here is the code if anybody has the problem

 

On the page with the form right under the call to include headers.php add this line

<?php
header( 'Cache-Control: private, max-age=10800, pre-check=10800' );
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...