The draw back with doing this via JavaScript is that you are limiting this feature to users who do not have JavaScript running in their browser. If it’s important that the page refresh for all users then I would suggest not doing it via JavaScript.
Doing it via PHP would run for all users, but the bigger question is why do you need to refresh the page? And could you achieve the same thing without refreshing the page?
4
solved Should I use PHP or Javascript for page refreshing? [closed]