Page 1 of 1

Newbie Sorry all

Posted: Tue Jan 04, 2005 10:11 am
by ringworm
I get this error msg

Notice: Undefined index: DOCUMENT_ROOT in c:\Inetpub\wwwroot\mystuff\processorder.php on line 8

from this code

$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];

I hope someone can help, using win2000 on iis am using the latest PHP

thanks

Posted: Tue Jan 04, 2005 10:15 am
by feyd
PHP Code is the correct forum for this :?

it appears that your version of IIS or php isn't setting the document_root value.

Posted: Tue Jan 04, 2005 10:24 am
by ringworm
sorry about that,

How would I go about fixing this problem?

Thanks

Posted: Tue Jan 04, 2005 10:27 am
by feyd
I don't know of anything that says it's supposed to be there. i.e. it's an optionally set value by the server from what I can tell.

out of curiousity, what version of php are you using? [php_man]phpinfo()[/php_man]

Posted: Wed Jan 05, 2005 4:22 am
by ringworm
version 5.0.3 trying to follow my way through a book. and now i am stuck o well?

Posted: Wed Jan 05, 2005 4:50 am
by ringworm
arrrr... yes ok made a change to the php.ini file it works but now i have another problem i get this error

Warning: flock() expects parameter 1 to be resource, boolean given in c:\Inetpub\wwwroot\mystuff\processorder.php on line 66

@ $fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'ab');

please help

flock($fp, LOCK_EX); // this is line 66

Posted: Wed Jan 05, 2005 9:08 am
by feyd
your call to fopen failed. Check the permissions of php to write in the wwwroot folder.