RE: [PHP] Checking if files are there?

From: Date: Wed, 24 Jan 2001 12:26:37 +0000
Subject: RE: [PHP] Checking if files are there?
Groups: php.general 
Request: Send a blank email to php-general+get-36402@lists.php.net to get a copy of this message
Yep. $file = @fopen (......... The @ sign suppresses the warning messages. Should work fine after this. HTH Jon -----Original Message----- From: Sam [mailto:Sam@dragoman.co.uk] 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: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#36402) next »