I'm a learner and keep running into problems in the book I can't get to run correctly. Here's my latest, it has something to do with the declaration of a variable used in an fopen function:
CODE:
$DOCUMENT_ROOT = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
ERROR:
Notice: Undefined index: DOCUMENT_ROOT in c:\inetpub\wwwroot\processorder.php on line 8
CODE:
$fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'a');
flock($fp, LOCK_EX);
ERRORS:
Warning: fopen(/../orders/orders.txt) [function.fopen]: failed to create stream: No such file or directory in c:\inetpub\wwwroot\processorder.php on line 63
Warning: flock(): supplied argument is not a valid stream resource in c:\inetpub\wwwroot\processorder.php on line 65
Any light one of you extremely smart and helpful PHP experts can shed on my problem would be greatly appreciated. Thanks!
Brian