Re: fopen warning error message
| From: | Chris Lee | Date: | Fri, 09 Feb 2001 01:35:35 +0000 |
| Subject: | Re: fopen warning error message | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-38869@lists.php.net to get a copy of this message | ||
@ sign is your friend.
if ($file = @fopen('...', 'r'))
{
} else
{
}
--
Chris Lee
Mediawaveonline.com
lee@mediawaveonline.com
""Ade Smith"" <ade@stormbreaker.com> wrote in message
news:NDBBKNBNILDDDJNONEHNKELLDMAA.ade@stormbreaker.com...
> Hi
>
> I am trying to open a file which exists remotely(code works), but there
may
> be times when it may not exist, however when I change the url so that it
> purposely doesn't exist to test this situation I get an error message like
> the following:
>
> Warning: fopen("<remote_url>","r") - No error in test.php on line 5
>
> How can I prevent this error message appearing and let my error checking
> below deal with it ?
> Here is my code:
>
> if(!$file = fopen("<remote_url>", "r")):
> echo"could not open remote file";
> else:
> <page code>
> endif;
>
>
> Many Thanks
>
> Ade
> -------------------------------------
> ade@stormbreaker.com
> -------------------------------------
>
>