You can open a file from a directory in the parent directory of this file using the relative path.
, /foo/x /foo/y ../x. , , , " ". , /foo/../foo/bar /foo/bar. , . hardcode - .
, /thefile.php admin/upload.php:
$this_dir = dirname(__FILE__);
$parent_dir = realpath($this_dir . '/..');
$target_path = $parent_dir . '/articles/' . $theFile . '.php';
$ourFileHandle = fopen($target_path, 'w') or die("can't open file");
paths.