I am trying to see if a URL exists or not, and if it does not exist reset the variable containing the URL to an error page/image. However my attempt below sets every instance of PIC_URL to noimage.gif, regardless of if it exists and is accessible or not. What am I missing?
if (@fopen($_REQUEST[$PIC_URL],"r"))
{
$status = "1";
}
else if (!(@fopen($_REQUEST[$PIC_URL],"r"))
{
$status = "2";
}
if ( $status == "2" ) $PIC_URL = "http://www.tricityhomes.com/assets/images/noimage.gif";