Php reload page without sending data

I am trying to refresh a page without sending a POST from a previous time.

I tried

window.open("postme.php?r=t", "_self"); 

What adds ?r=t to the end, but does not refresh the page, since the page displays the number of files in the directory that has not changed, although I moved or deleted them.

Can you specify the url in window.location.reload(); ?

Any ideas?

thank

+6
javascript html php refresh
Jul 02 '09 at 10:18
source share
6 answers

To make this work ...

window.location = "postme.php? r = t";

-one
Jul 02 '09 at 10:57
source share

If you want to avoid updating the report data (for any reason, including the user pressing the reset button), use the POST-REDIRECT-GET template .

+5
Jul 02 '09 at 10:58
source share

Redirect the user to the same page after completing the use of their POST data.

 $URI = $_SERVER['REQUEST_URI']; if(!empty($_POST)){ //magic header("location:$URI"); } 

Now when you upgrade, it will not have POST data to resubmit.

+2
02 Sep '15 at 13:23
source share

You can try:

 window.location.reload(true); //true sets request type to GET 
+1
Jul 02 '09 at 10:23
source share

I know that it is too late, and I hope that it applies: I had the same problem when someone confirms the choice of their inventory, then he sends an email by order [or subtracts from the inventory database] and then displays their order. then if they are updated, it retransmits the data. so I added session_destroy (). but then when they are updated, there are many errors.

SO - I split the code into [a] email address by order / subtract from the inventory database, then [b] used javascript "document.location.href = 'nextPage.php", because sometimes there are problems using PHP "location (nextpage.php) ". in any case, he sends an email of information, then goes to a page that displays it. then you can update everything that they want, and everything that happens will be displayed again and again.

hope this helps!

+1
Apr 26 '11 at 19:55
source share

Okay .. too late, I guess, but then it can help someone. I used:

 window.location.href = window.location.href; 

Instead, location.reload (); this will refresh the page without prompting the user to resend the information.

0
Mar 08 '15 at 11:17
source share



All Articles