+ 1
How do i refresh a page using PHP/JS/JQUERY
I'm working on a website and i want it to refresh the page anytime it fails to connect to the database... And can i put this refresh function in the die() method....... If i can't do it with php, then can i do it with javascript or jquery.
1 Odpowiedź
+ 1
PHP:
header("Refresh:0");
JS:
window.location.reload()
window.location.href = window.location.href;
jQuery:
location.reload();
If you've already sent headers in your PHP, then in your JS/jQuery callback after PHP fails, you can refresh it from there.