title: PHP file_exists method not working as expected
body: <p>I am trying to set the background of the html body dynamically. Basically if a file exists, use it, otherwise use the default. But it keeps using the default regardless of whether the file exists or not.</p>
  
  <pre><code>&lt;style&gt;
  body
  {
      padding-top: 50px;
      background-image: url("&lt;?php
      clearstatcache();
      if(file_exists("/profile_img/".$profileData["ID"]."_bg.jpg"))
      {
          echo "/profile_img/".$profileData["ID"]."_bg.jpg?". rand(5, 15);
      }
      else
      {
          //echo "/profile_img/".$profileData["ID"]."_bg.jpg?". rand(5, 15);
          echo "/profile_img/default.jpg?". rand(5, 15);
      }
      ?&gt;");
      background-size: cover;
      background-position: 50% 50%;
  }
  &lt;/style&gt;
  </code></pre>
  
  <p>I have tried using the file (the commented line) and it works. I can not see why this doesn't work</p>