I'm using a PHP refresh. The code looks like this: <?php header("refresh: 10; url=some_url"); ?> Code (markup): As you can see, it's set to refresh after 10 seconds. Questions: Does it refresh 10 seconds after the whole page has downloaded, including all images, or 10 seconds after the HTTP request? Are PHP refreshes more reliable and compatible than meta refreshes? Which one would you use if you had to do a refresh?
PHP refresh is executed from the server.. Meta refresh executed from the browser.. In php the function will be triggered when you call it.. In meta it will be triggered after the whole page loaded..
I have put the PHP refresh right at the top of my document, above the doctype. Do you mean if it's called low in the page? But I thought PHP refreshes could only be put at the very top of the page, before any output to the client. Isn't that so? Thanks for the responses, guys, but can anyone answer my 2 questions? Does it refresh 10 seconds after the whole page has downloaded, including all images, or 10 seconds after the HTTP request? Are PHP refreshes more reliable and compatible than meta refreshes? Which one would you use if you had to do a refresh?
1. It may depend on browser implementation. I think timer starts right after the whole page is loaded. Anyway you could measure this by yourself 2. It seems header refresh and meta refresh act the same way, read more here. By the way, W3C lists META refresh as deprecated element.