title: Create file for download without saving on server with PHP
body: <p>Say my PHP code was</p>
  
  <pre><code>&lt;?php
  
  // Get form variables using POST method
  $MarriagePostMortem=stripslashes($_POST['MarriagePostMortem']);
  $AutoSavesToKeep=stripslashes($_POST['AutoSavesToKeep']);
  
  // Open and write file
  $myFile="S3S.cfg";
  $fh = fopen($myFile, 'w+') or die("can't open file");
  fwrite($fh, "The Sims 3 Starter Configuration
  -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
  MarriagePostMortem  $MarriagePostMortem
  AutoSavesToKeep $AutoSavesToKeep
  -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-");
  fclose($fh); 
  
  //echo "file written\n";
  ?&gt;
  </code></pre>
  
  <p>I want to send the file directly to the user for download without saving it to the server. I'm <strong>really</strong> not all that great with PHP, so what exactly would I need to add/change to do so?</p>