SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Banana Man's Avatar
    Join Date
    Dec 2005
    Posts
    391
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    $_server['document_root']

    Hey,

    Can someone tell me is the error below a problem with the server im running the code on or could it be a problem with my coding?

    here is my line of code:
    include_once $_SERVER['DOCUMENT_ROOT'].'/stafford_scripts/header.php';

    Thanks

    Code:
    Notice: Undefined index: DOCUMENT_ROOT in d:\Domains\mywebsite.ie\wwwroot\my_website\register_script.php on line 2
    
    Warning: include_once(/stafford_scripts/header.php) [function.include-once]: failed to open stream: No such file or directory in d:\Domains\mywebsite.ie\wwwroot\my_website\register_script.php on line 2

  2. #2
    Chessplayer kleineme's Avatar
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's a problem with your server which doesn't provide a variable called DOCUMENT_ROOT. You can see all those variables by
    echo nl2br(print_r($_SERVER, true));
    Never ascribe to malice,
    that which can be explained by incompetence.
    Your code should not look unmaintainable, just be that way.

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    document_root is only set if your web server supports it.

  4. #4
    SitePoint Zealot
    Join Date
    Dec 2006
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can show us the 1st few lines of your code?


Bookmarks

Posting Permissions

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