Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hey;
I just started learning PHP so this is probably an easy question to you guru's.
Im following SAMS PHP in 24 hrs.
One of the .php files in the examples directory contains the command:$DOCUMENT_ROOT = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
Every time I run the PHP file i get the same error:
Notice: Undefined index: DOCUMENT_ROOT in c:\inetpub\wwwroot\junk\processorder.php on line 8
It seemed to me the problem had to do with doc_roots environmental variable in php.ini but when I tried setting this to the directory that my files I need to open were in it keeps giving me the same error.
Please note that the rest of the php in the file works and displays correctly.
I am running IIS on xp pro.So what do you think is wrong?? Is it a syntax thing or a directory thing?? All input is welcome
Thanks;

First off, you should consider notating $HTTP_SERVER_VARS['DOCUMENT_ROOT'] as $_SERVER['DOCUMENT_ROOT'], which is the way things seem to be heading (since PHP 4.2.x and 5.x). Not a problem, just a suggestion.
Secondly, IIS doesn't seem to give you the option to use this variable. The PHP documentation has a solution to this mentioned in the comment section. There's a similar workaround in this thread. Another solution is listed under the reported PHP bug on this issue (though it's not a bug).

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |