What is the difference between reload in JS
location.reload();
and refresh in PHP
header("Refresh:0");
From W3Schools:
The reload() method is used to reload the current document.
The reload() method does the same as the reload button in your browser.
By default, the reload() method reloads the page from the cache, but you can force it to reload the page from the server by setting the forceGet parameter to true:
location.reload(true)
header("Refresh:0"); do the same as reload() (refresh current page). You can also set time interval and location for refresh.
header("Refresh:0; url=page2.php");
it will now refresh from page2.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With