title: refreshing after php serves a download
body: <p>Page 1 links to page 2. Page 2 serves a download using the following code:</p>
  
  <pre><code>header("Content-disposition: attachment; filename= '$filename'");
  header('Content-type: application/pdf');
  readfile($file);
  header("location: mainpage.php");
  </code></pre>
  
  <p>The result being the user "stays" on page 1 but is served a download. </p>
  
  <p>How can I set things up, so that users remain on page 1 but it refreshes after the download is served.</p>
  
  <p>I don't know javascript so I am hoping for a purely PHP solution.</p>