Newbie Sorry all

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

Post Reply
ringworm
Forum Newbie
Posts: 5
Joined: Tue Jan 04, 2005 10:06 am

Newbie Sorry all

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
ringworm
Forum Newbie
Posts: 5
Joined: Tue Jan 04, 2005 10:06 am

Post by ringworm »

sorry about that,

How would I go about fixing this problem?

Thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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]
ringworm
Forum Newbie
Posts: 5
Joined: Tue Jan 04, 2005 10:06 am

Post by ringworm »

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 »

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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your call to fopen failed. Check the permissions of php to write in the wwwroot folder.
Post Reply