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]/../orders/orders.txt", 'w');
My questions about the relative path in the code above are that:
$_SERVER[DOCUMENT_ROOT]
points to the very root directory of the file structure like htdocs, www or public_html on different servers. Please guide if I am understanding it correctly?Thank You
..
means the parent directory, so it goes one level up there and into a sibling directory of your document root called orders
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With