From "should be simple" file-writing-reading-etc. tutorial:
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT']; // F:/wamp/www
// open file for appending
@ $fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'ab');
/*From instructions: "This directory is outside the document tree,
for security reasons. In this case, we do not want this
file to be web accessible except through the interface that we provide" */
flock($fp, LOCK_EX);/*Outputs: Warning: flock() expects parameter 1 to be resource, boolean given in F:\wamp\... ...on line 68.*/
1)So F:/wamp/www is the 'document root' and if I'm not mistaken this part of the code "$DOCUMENT_ROOT/../orders/orders.txt" writes (or should write) to F:/wamp/orders/orders.txt if you write it in absolute path? Please confirm if I got that right?
2)Then, how do you allow script to write to upper ('parent') directory of /www?