title: Using _top redirect from PHP
body: <p>I have question regarding PHP and redirecting a page. In my HTML I have an iframe.</p>
  
  <pre><code>&lt;iframe class="container" name="content" id="content"  src="LandingPage.php" name="contents" scrolling="no" frameborder="0"  onload="sizeFrame(this)" &gt;&lt;/iframe&gt;&lt;!-- CONTENT frame --&gt;
  </code></pre>
  
  <p>I want to reload the whole document to index.php and not just display index.php in the iframe. Currently all my efforts and searched suggestions load the index.php file in the iframe. How can I force the page to unload the current loggedin.html file and reload only index.php in the same window?</p>
  
  <p>I tested the following at the top of LandingPage.php to make sure the page can be displayed.</p>
  
  <p>It is not the session that is faulty as the index.php file is displayed just not in the correct place.</p>
  
  <pre><code>       if(! isset($_SESSION['loginvalid']))
  {
      //header("Location: index.php");
       //exit();
       $URL="index.php";
       $t = "_top";
       echo "&lt;script&gt;window.location.replace='$URL'  target= '$t'&lt;/script&gt;";
       //echo"window.location.href = $URL target= \"_top\"";
       exit;
  
      } else {
  </code></pre>
  
  <p>Any help and suggestions will be appreciated.</p>