title: Why PHP include is working on local server and not on website
body: <p><em>Problem Description in Brief:</em><br/>
  PHP script seems to work on my local web server when I 'include' it from the footer tag of my <strong>index.html</strong> file, but does not work when I upload it to my website.  Note that I have made sure that all paths are correct, and that the script file has its own php tags, etc.</p>
  
  <p><em>Problem Description in Detail:</em><br/>
  Yes, I am new to PHP scripting, and yes, variants of this question have probably been asked before.  The answers to a few of the questions I have read have noted the path of the php script files to be incorrect.  I have checked all paths and confirmed that they are indeed correct (including those on the web hosting server).  Furthermore, I have been successful in getting the script to work on my local server running Apache2 with PHP5, but have not been successful when uploading it to my website.</p>
  
  <p>Essentially, I am trying to implement a hit counter script which I have acquired from a Stack Overflow post labelled <a href="https://stackoverflow.com/questions/11138020/visitors-counter-for-simple-web-sites-like-vinaora">Visitors counter for simple web sites like Vinaora</a>.  The code that invokes the php script looks something like this....</p>
  
  <pre>
    &ltfooter&gt
      &lt!-- Execute Hit Counter Script --&gt
      &lt?php include($_SERVER['DOCUMENT_ROOT'].'/php/hitcounter.php'); ?&gt
    &lt/footer&gt
  </pre>
  
  <p>For the likes of me, I cannot figure out why it does not work on the web hosting server.  I have tried other combinations of invoking the script like,</p>
  
  <pre>
    &ltfooter&gt
      &lt!-- Execute Hit Counter Script --&gt
      &lt?php include('./php/hitcounter.php'); ?&gt
    &lt/footer&gt
  </pre>
  
  <p>and,</p>
  
  <pre>
    &ltfooter&gt
      &lt!-- Execute Hit Counter Script --&gt
      &lt?php include(dirname(__FILE__).'/php/hitcounter.php'); ?&gt
    &lt/footer&gt
  </pre>
  
  <p>All combinations seem to work on my local web server, but not on the website!  Also note that, I have no problem invoking other PHP scripts using other methods (even on the web hosting server), eg.</p>
  
  <pre>
      &ltform id="form-query" onsubmit="this.checkValidity();" action="./php/contact.php" method="post"&gt
  </pre>
  
  <p>Any advice/suggestions would be appreciated.</p>