PHP file_exists not working
<p>I'm trying to make profile photos show up against a list of reviews on a site I'm working on. If they don't have a profile photo I have a standard image to show instead, unfortunately the image always goes to the standard image rather than the profile even if it exists. Heres the code:</p>

<pre><code>$reviewerPic = 'http://www.[URL].co.uk/images/members/' . $reviewPosterId . '/profilePic.jpg';
$default_pic = 'http://www.[URL].co.uk/images/background.jpg';
    if(file_exists($reviewerPic)){
        $reviewer_pic = '&lt;img src="' . $reviewerPic . '" width="100px" style="float: left; margin: 20px;" /&gt;';
    }else {
        $reviewer_pic = '&lt;img src="' . $default_pic . '" width="100px" style="float: left; margin: 20px;" /&gt;';
}
</code></pre>

<p>Pretty generic code but it doesn't seem to work! It just keeps showing the background image...</p>

<p>Any ideas on why file_exists wouldn't be working?</p>

<p>Cheers,</p>

<p>Jack</p>
