title: PHP $_SERVER['DOCUMENT_ROOT']
body: <pre><code>        $username;
          $welcomeMessage;
          if( isset( $_SESSION['username'] ) ){
              $username = $_SESSION['username'];
              $welcomeMessage = "Hello $username! | ";
              $welcomeMessage .= '&lt;a href="'.$_SERVER['DOCUMENT_ROOT'].'/nmc/Admin/LogoutProcessor.php"&gt;Logout&lt;/a&gt;';
          } else {
              $welcomeMessage = "Welcome | ";
              $welcomeMessage .= '&lt;a href="'.$_SERVER['DOCUMENT_ROOT'].'/nmc/Admin/LoginPage.php"&gt;Login&lt;/a&gt;';
          }
  </code></pre>
  
  <p>The code above returns "file:///C:/xampp/htdocs/nmc/Admin/LoginPage.php"</p>
  
  <p>I am using xampp to develop a website, basically uses its own server processing, therefore I can't use the above link. I have several webpages in different directories which have to link to the LoginPage.php, and I need a standard link. The above code is in a Class where other pages in different directories can call it.</p>
  
  <p>Can anyone tell me how to resolve this problem?</p>
  
  <p>Thanks!</p>