So, I'm starting the book "PHP and MySQL Web Development 4th Edition" and have a question about some code from chapter 2.
In the sample script you declare a variable
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
This is then used later when opening/creating a file for writing:
@ $fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'ab');
Unfortunately, it gives me an error saying the directory doesn't exist.
Now if I eliminate the /.. part of the path it works fine.
I seem to be having a reading comprehension problem as the text says ".." is used to mean "the parent directory of the document root directory" and I'm not entire sure what this means. Right now my orders folder is in the same folder as my script that executes this command:
/Applications/XAMPP/xamppfiles/htdocs/processorder.php