Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php reload page without posting data

I'm trying to refresh a page without sending POST from the previous time.

I've tried

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

Which appends a ?r=t to the end but it doesn't appear to refresh the page as the page displays a number of files in a directory which hasn't change even though I have moved or deleted them.

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

Any ideas?

Thanks

like image 227
thegunner Avatar asked Jul 02 '09 10:07

thegunner


People also ask

How can I reload my current page without losing data?

The easiest way to reload the current page without losing form data, use WebStorage where you have -persistent storage (localStorage) or session-based (sessionStorage) which remains in memory until your web browser is closed. window. onload = function() { var name = localStorage.

How do I refresh a page without reloading the whole page?

AJAX = Asynchronous JavaScript and XML. AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.


1 Answers

If you want to avoid having refresh reporting data (for any reason, including the user clicking the reload button) then use the POST-REDIRECT-GET pattern.

like image 66
Quentin Avatar answered Nov 15 '22 17:11

Quentin