title: Failed to open stream: No such file of directory in... PHP fopen
body: <p>this is my code</p>
  
  <pre><code>include 'connection.php';
  setcookie('username',$name,time()+86400,"/");
  echo $_COOKIE['username'];
  $my_file = '/../../users/'.$name."/index.php";
  $handle = fopen($my_file, 'w') or die('Cannot open file:  '.$my_file);
  </code></pre>
  
  <p>when the code runs I want it to create a file with the directory <code>/../../users/[username]</code> where <code>[username]</code> is stored in the <code>$name</code> variable. When I run my code it just gives me a lousy error and it doesn't run any code after line 6 from above.</p>
  
  <p>It won't create the file and the error is...</p>
  
  <blockquote>
    <p>Warning: fopen(/../../users/codemaster7/index.php) [function.fopen]: failed to open stream: No such file or directory in /nfs/c02/h10/mnt/45563/domains/pizzascripters.com/html/projects/nik/Champion/register/index.php on line 107
    Cannot open file: /../../users/codemaster7/index.php</p>
  </blockquote>
  
  <p>Does anyone have an idea on whats going on and how I can fix it?</p>