I am new to programming and learning php on my own. I have two question about the following relative path of a file
$fp = fopen (\"$_SERVER[DOCUMENT_ROOT]/..
.. means "go up one directory".
So, if your DOCUMENT_ROOT was:
/usr/docs/document_root
your path works out to:
/usr/docs/document_root/../orders/orders.txt
Since the .. means "go up one", it in fact becomes:
/usr/docs/orders/orders.txt
You can see how it "erases" the "document_root" part.