title: PHP: How to hide URL
body: <p>I have the following <code>download.php</code> script to download a file, which works great:</p>
  
  <pre><code>&lt;?php
  
  header("Content-Type: application/octet-stream");
  
  $file = $_GET["file"];
  header("Content-Disposition: attachment; filename=" . urlencode($file));   
  header("Content-Type: application/force-download");
  header("Content-Type: application/octet-stream");
  header("Content-Type: application/download");
  header("Content-Description: File Transfer");            
  header("Content-Length: " . filesize($file));
  flush(); 
  $fp = fopen($file, "r");
  while (!feof($fp))
  {
      echo fread($fp, 65536);
      flush(); 
  } 
  fclose($fp);
  
  ?&gt;
  </code></pre>
  
  <p>What I want to achieve is to hide the URL where this file is located, so that when the user clicks a link such as <code>&lt;a target="_blank" href="http://domain.com/files/download.php?file=filename.pdf"&gt;Download file&lt;/a&gt;</code>, a new tab opens up with no URL and starts downloding the file. What is actually happening is the new tab opens and the file download starts but the URL bar is displaying <code>http://domain.com/files/download.php?file=filename.pdf</code>.</p>
  
  <p>If this cannot be done with php, how can I achieve this? I have seen several downloads where the URL is not shown, so I know this is somehow possible.</p>
  
  <p>EDIT: Here is the reason I want to do this: We will send a html mailing with a link to the file download, and the website where this file download is hosted is not the website from the company which sends the mail.</p>
  
  <p>As always, thank you very much.</p>