{"id":459,"date":"2012-07-20T16:32:35","date_gmt":"2012-07-20T16:32:35","guid":{"rendered":"https:\/\/ibex.tech\/cloud\/?p=459"},"modified":"2022-02-17T07:14:04","modified_gmt":"2022-02-17T07:14:04","slug":"reload-page","status":"publish","type":"post","link":"https:\/\/ibex.tech\/cloud\/php\/page-control\/reload-page","title":{"rendered":"Reload page"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">Reload the current page<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  header('Location: '.$_SERVER['PHP_SELF']);\n  die;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Form reloads current page<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;form action=\"&lt;?php $_SERVER['PHP_SELF'];?>\" method=\"POST\"><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Link reloads current page<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;a href=\"&lt;?php $_SERVER['PHP_SELF'];?>\">Refresh&lt;\/a><\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Reload current page but with post values stripped<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  unset($_POST);\n  header('Location: '.$_SERVER['PHP_SELF']);\n  die;<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Using javascript <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\/\/Cause the page to reload from PHP\n\techo \"&lt;script type=\\\"text\/JavaScript\\\">\n\t\t\t\t&lt;!--\n\t\t\t\twindow.location.reload()\n\t\t\t\t-->\n\t\t\t\t&lt;\/script>\";<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>href=\"javascript:window.location.reload();\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Periodic Refresh<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;meta http-equiv=\"refresh\" content=\"5\" \/> &lt;!-- Cause page to reload every # seconds --><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Reload the current page Form reloads current page Link reloads current page Reload current page but with post values stripped Using javascript Periodic Refresh<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-459","post","type-post","status-publish","format-standard","hentry","category-page-control"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/comments?post=459"}],"version-history":[{"count":10,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":2536,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/posts\/459\/revisions\/2536"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/media?parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/categories?post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/cloud\/wp-json\/wp\/v2\/tags?post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}