+ 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.

4th Aug 2021, 9:15 PM
Abdulmumin Alhassan
Abdulmumin Alhassan - avatar
1 Antwort
+ 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.
4th Aug 2021, 9:46 PM
Jakko Jak
Jakko Jak - avatar