My folder structure is like -
root admin create_page.php pages my_page1.php my_page2.php
I have code for creating a new php fi
$ourFileHandle = fopen("../pages/" .$ourFileName, 'w') or die("can't open file");
Make the above change to the third line and it will probably work; I tried it and it worked.