Home » Php » php – To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier

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

Posted by: admin July 12, 2020 Leave a comment

Questions:

Hey I am getting this confirmation by firefox.

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

Anybody knows what is this confirmation for?

And how to get rid out of this?

How to&Answers:

This happens when you refresh a page that is the result of a POST request (as opposed to a GET request).

To avoid it, you can use the POST/redirect/GET pattern.

Answer:

Try to change your request type from POST to GET.

If not possible to change the request type,
For reloading the page, try using:

window.location=window.location;

Instead of

window.location.reload();

As suggested in answer to the question preventing firefox reload confirmation

Worked very well in Firefox, Chrome..

Answer:

I had this issue on a website I made. I ended up doing all of the backend work, then using this code:

header("Location: webpage.php", true, 303);

This clears out any post data and redirects the page so reloading will not cause that message anymore.

Answer:

This is happening when you refresh a page to which some POST data was sent (for example, when you have completed a form). This question is asking you if you want to re-send that data so, if you made a search the searched term will be sent again to the server. This is dangerous when you completed a form where you have ordering something, so refreshing the page and resending the data will make a new order in that site.

Answer:

Sounds like the request to the page was from a POST.

You should use the Post/Redirect/Get pattern.

Answer:

Changed the method request type from POST to GET in my search form and got rid of the confirmation box..

Answer:

replace the existing code “top.location.reload() ” with code “top.location.href=top.location.href”
https://support.mozilla.org/en-US/questions/695164

Answer:

The way Firefox is giving warning ; saying you’re re-submitting form with post method.

below workaround worked for me.

<form id="yourDummyform" method="post" action="yourPostActionURL?var1=val1&var2=val2">

<!--or some hidden variables here -->

</form>

on Success of ajax call or some event
do

$("#yourDummyform").submit();

Answer:

I have overcome this problem for my requirement like this.
I have added following code after form submit

document.getElementById("frmtbl").submit();
document.getElementById("nxt").click();
document.getElementById("frst").click();

nxt and frst are links for next and first page on the navigation bar.
Others may get clue.