title: How to get file contents in PHP - function doesn't seem to find it
body: <p>I have this line in a function:</p>
  
  <pre><code>$template = file_get_contents('signup_template.html');
  </code></pre>
  
  <p>The problem is that PHP doesn't find the file, yet it is there in the same directory as the function.</p>
  
  <p>Is there some other directory it should be in? In the root of the site?  Or maybe a permissions problem?</p>
  
  <p><em>Update:</em></p>
  
  <p>Got it to work with this:</p>
  
  <pre><code>$template = file_get_contents(__DIR__ . '/signup_template.html');
  </code></pre>
  
  <p>It seems the issue is that the full path is required to get file contents.</p>
  
  <p>Also, the <strong>DIR</strong> was not the directory of the function (which was in a subdirectory), but the directory of the page which included the function.</p>
  
  <p>Greg</p>