PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ringworm
Forum Newbie
Posts: 5 Joined: Tue Jan 04, 2005 10:06 am
Post
by ringworm » Tue Jan 04, 2005 10:11 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jan 04, 2005 10:15 am
PHP Code is the correct forum for this
it appears that your version of IIS or php isn't setting the document_root value.
ringworm
Forum Newbie
Posts: 5 Joined: Tue Jan 04, 2005 10:06 am
Post
by ringworm » Tue Jan 04, 2005 10:24 am
sorry about that,
How would I go about fixing this problem?
Thanks
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Jan 04, 2005 10:27 am
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]
ringworm
Forum Newbie
Posts: 5 Joined: Tue Jan 04, 2005 10:06 am
Post
by ringworm » Wed Jan 05, 2005 4:22 am
version 5.0.3 trying to follow my way through a book. and now i am stuck o well?
ringworm
Forum Newbie
Posts: 5 Joined: Tue Jan 04, 2005 10:06 am
Post
by ringworm » Wed Jan 05, 2005 4:50 am
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jan 05, 2005 9:08 am
your call to fopen failed. Check the permissions of php to write in the wwwroot folder.