So what is in $sStatus immediately before calling the is_file check? The only tests I've run indicate that it is 00 that I get, but that doesn't mean you get the same depending on your results (since I also get the page cannot be found when I provide it with the headers to mock the browser).
I'm wondering if it needs more header information since I do get differing information based on what it is given.
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php