PHP refresh window? equivalent to F5 page reload? PHP refresh window? equivalent to F5 page reload? php php

PHP refresh window? equivalent to F5 page reload?


Actually it is possible:

Header('Location: '.$_SERVER['PHP_SELF']);Exit(); //optional

And it will reload the same page.


If you have any text before a

header('Location: http://www.example.com/youformhere.php');

you'll have issues, because that must be sent before any other text is sent to the page.

Try using this code instead

<?php $page = $_SERVER['PHP_SELF'];echo '<meta http-equiv="Refresh" content="0;' . $page . '">';?>

Just remember, this code will create and infinite loop, so you'll probably need to make some conditional changes to it.


With PHP you just can handle server-side stuff. What you can do is print this in your iframe:

parent.window.location.reload();