Yep. 

$file = @fopen (.........

The @ sign suppresses the warning messages. Should work fine after this.

HTH
Jon


-----Original Message-----
From: Sam [mailto:[EMAIL PROTECTED]]
Sent: 24 January 2001 12:19
To: 'php'
Subject: [PHP] Checking if files are there?


Hi all, 

I was wondering if you could use PHP to test if a picture is there?
I.E. checking if you could open the picture or not, and displaying a message
either way.

I have tried

$file = fopen ("../images/maps/$filename.jpg", "r");
if (!$file) {
        print "This is no map for this trip.";
        exit;
}
else
{
        print "<img src=/images/maps/$filename.jpg>"; 
}

This works but also brings up a warning message as well, which is not
wanted.
Is there a way to get rid of the warning message?

Thanks in advance
Sam Rose

-- 
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]

-- 
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]

Reply via email to