title: Failed to open stream PHP fopen() not working
body: <p>I am trying to create .txt files on my server, after given input, but i get the error shown at the bottom. </p>
  
  <pre><code>&lt;?php
  
  $filename = $_GET["firstname"]. " ". $_GET["lastname"].".txt";
  
  $myfile = fopen("$filename", "w") or die("Unable to open file!");
  
  $txt = "Stuur een leuk berichtje naar deze persoon: ". $_GET["emailadres"];
  
  fwrite($myfile, $txt);
  fclose($myfile);
  
  ?&gt;
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>Warning: fopen(test.txt): failed to open stream: Permission
    denied in /home/students/57fasdf6/www/bevestiging.php on line 37 Unable
    to open file!</p>
  </blockquote>
  
  <p>Thanks in advance!</p>
  
  <p>Greets,</p>
  
  <p>Rex</p>