title: file_exists() isn't finding the file
body: <pre><code>if(file_exists("./squadra/photos/photog.jpg")) {
      echo "### YES ###";
  } else {
      echo "### NO ###";
  }
  </code></pre>
  
  <p>if i run this function on /zones/team.php it works (it print YES). If i run this function on /auth/ajax.php it print NO. Why?</p>
  
  <p>EDIT</p>
  
  <p>So i make some experiment.</p>
  
  <p>1 - If i try :</p>
  
  <pre><code>// file on /zones/team.php
  if(file_exists($_SERVER['DOCUMENT_ROOT']."/squadra/photos/provag.jpg")) {
      echo "YES";
  } else {
      echo "NO";              
  }
  
  // file on /auth/ajax.php
  if(file_exists($_SERVER['DOCUMENT_ROOT']."/squadra/photos/provag.jpg")) {
      echo "YES";
  } else {
      echo "NO";              
  }    
  </code></pre>
  
  <p>it says NO on both;</p>
  
  <p>2 - If i try :</p>
  
  <pre><code>// file on /zones/team.php
  if(file_exists("./squadra/photos/provag.jpg")) {
      echo "YES";
  } else {
      echo "NO";              
  }
  
  
  // file on /auth/ajax.php
  if(file_exists("../squadra/photos/provag.jpg")) {
      echo "YES";
  } else {
      echo "NO";              
  }
  </code></pre>
  
  <p>it says YES on both; But on team.php im using ./ and on ajax.php ../ ...why this works???</p>