Is the following code below possible? Or no because its a security issue? I'd like to fwrite across from one folder to another so if the fwrite function is located at /1, can I fwrite to a .txt file on /2?
<?php
$myFile = "../news/derp.txt";
$fh = fopen('derp.txt', 'w') or die("File Can't Be Written To.");
$stringData = "Yo, .";
fwrite($fh, $stringData);
fclose($fh);
?>
As long as the script is being executed in a context where it has write permissions to the file, it should work.
The security issue question requires more information about what you are doing with it and whether or not the second directory is publicly visible.