@ sign is your friend.
if ($file = @fopen('...', 'r'))
{
} else
{
}
--
Chris Lee
Mediawaveonline.com
[EMAIL PROTECTED]
""Ade Smith"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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
> -------------------------------------
> [EMAIL PROTECTED]
> -------------------------------------
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]