title: create file in another directory with php
body: <p>My folder structure is like - </p>
  
  <pre><code>root
    admin
      create_page.php
    pages
      my_page1.php
      my_page2.php
  </code></pre>
  
  <p>I have code for creating a new php file in "pages" folder. the code is like - </p>
  
  <pre><code>$dir_path = "../pages/";
  $ourFileName = '../'.$page_name.".txt";
  $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
  $ourFileContent = '&lt;?php echo "something..." ?&gt;';
  if (fwrite($ourFileHandle, $ourFileContent) === FALSE) {
      echo "Cannot write to file ($filename)";
      exit;
  }
  </code></pre>
  
  <p>The code executes normally..no problem. but the page is not being created. please tell me what i am doing wrong. is there problem with the path?
      fclose($ourFileHandle);</p>