title: PhP download link with variables
body: <p>Ok, so I'm trying to create a download link generator on my site.
  What I mean by that is this :</p>
  
  <ol>
  <li><ul>
  <li>the user writes "list X" and the site lists every file in a given directory</li>
  </ul></li>
  <li><ul>
  <li>every file has a number (from 0 to n)  </li>
  </ul></li>
  <li><ul>
  <li>when the user types : "download 5" for example</li>
  </ul></li>
  <li><ul>
  <li>it redirects the user to a download script</li>
  </ul></li>
  <li><ul>
  <li>the script makes it so that the user has a download "box" that pops-up</li>
  </ul></li>
  </ol>
  
  <p>I first thought that I could create an array with every file name and then use the position in that array for the "download X" command.</p>
  
  <p>So that, when he redirects the user to the download script, the variable with the name of the file that the user wants to download is "POST"ed to the download script and the header is changed in consequence.</p>
  
  <p>So here are my two questions :</p>
  
  <p>1) - How do you change the download script according to the users input ?
  2) - The input field is already used for other purposes with a "$_SERVER['PHP_SELF']", so I don't know how to "POST" variables without a form ?</p>
  
  <p>This is my simple download script : </p>
  
  <pre><code>&lt;?php
  header('Content-disposition: attachment; filename=huge_document.pdf');
  header('Content-type: application/pdf');
  readfile('huge_document.pdf');
  ?&gt;
  </code></pre>
  
  <p>Thanks in advance !</p>