Forum Moderators: coopster
<?php
header("refresh: 10; url=some_url");
?>
As you can see, it's set to refresh after 10 seconds.
Questions:
1) Does it refresh 10 seconds after the whole page has downloaded, including all images, or 10 seconds after the HTTP request has been sent to the server?
2) Are PHP refreshes more reliable and compatible than meta refreshes? Which would you use if you had to do a refresh?
2) I don't think there is a difference between a PHP refresh and a standard meta refresh other than syntax.
These would all be functionally the same.
<?php
header("refresh: 10; url=some_url");
?>
<?php
echo '<META http-equiv="refresh" content="10"; http://example.com/somepage.html>';
?>
Or just place this in the head section of your HTML document.
<META http-equiv="refresh" content="10"; http://example.com/somepage.html>
As far as What I would do about refreshing a page it depends on the situation. From your example
I am using a PHP refresh to redirect visitors to another site after a short delay
Are you wanting to forward for an entire site or after a brief delay after signing up or something similar?