title: Using php file_get_contents() does not work when using ajax
body: <p><strong>UPDATE:  this problem was solved, my issue was a typo.  The concept of what I was doing was correct.</strong></p>
  
  <p>I have a check if an image exits when I first display my page.  It prints out:</p>
  
  <pre><code>if (@file_get_contents($url) != false)
  {
       // show URL
  }
  else {
      // Show Placeholder Image
  }
  </code></pre>
  
  <p>This code works, when I have my page first load and the php is written with the HTML.</p>
  
  <p>BUT on other occasions, when I do a jQuery <code>.post</code> or <code>.get</code> call (so basically ajax) doing the file check above ALWAYS fails.  I have printed out the URL and it points to correct file (I can do this by unsupprressing the errors).  Now, the url is a different domain then the original file that is being called, so not sure if it is a cross domain issue (it is also a website that belongs to me so I have full access to the files).</p>
  
  <p>Is this code not working due to ajax?  Cross Domain? something else?</p>
  
  <p>Also, I have tried <code>file_exists</code>, <code>getimagesize</code> and <code>cUrl</code> as well to no avail.</p>
  
  <p>EDIT:</p>
  
  <p>Here is my message when errors are not suppressed:</p>
  
  <blockquote>
    <p>Warning: <code>file_get_contents(http://www.---.---)</code> [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in --- on line 352</p>
  </blockquote>