title: PHP: give alert popup then redirect the page
body: <p>I am new to PHP.</p>
  
  <p>When someone uploads a file size too big, I want to show them a warning popup and redirect them to a previous page (or vice versa).</p>
  
  <pre><code>if(file size is too big){    
     ob_start();   
     header("location:index.php");    
     echo "&lt;script type='text/javascript'&gt;alert('Your File Size is too big!');&lt;/script&gt;";   
     ob_end_flush();   
     exit;    
  }
  </code></pre>
  
  <p>This code above will just redirect me to index.php and doesn't show any warning popup.</p>