Results 1 to 2 of 2

Thread: $document_root

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    Holland
    Posts
    24

    $document_root

    Why does this work in one script and not in another one:



    PHP Code:
    if ( $DOCUMENT_ROOT == "c:/html_docs" )
        {
                
    $file_dir "C:html_docs/mijn_documenten";       
                
    $file_url "http://server/mijn_documenten/";
        }
        
    elseif ( 
    $DOCUMENT_ROOT == "/www/clingse" )

        {
                
    $file_dir "/home/clingse/www/mijn_documenten";   
                
    $file_url "http://clingse.com/mijn_documenten/"
        } 
    It is handy because I am running PHP local on windows 2000 and my ISP is running unix.
    I am getting parse errors in one file undefined Var $DOCUMENT_ROOT BUT NOT in another script in the same dir and the same computer??????
    I am looking a this problem for to long now I need help.
    Thanks in advance
    Brian
    Homer no function beer well without.
    --Homer Simpson

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Probably because they are differing versions of PHP. Since PHP 4.1, $DOCUMENT_ROOT is deprecated, and register_globals is turned off by default.

    Use $_SERVER['DOCUMENT_ROOT'] instead. It should work in both.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width