Re: Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2005 at 06:48:25AM +0100, twistednetadmin wrote:
> This did the trick:
> 
> elseif ($_FILES['guildimage']['type'] == "image/pjpeg" or "image/jpeg")

Not for reasons you think.  The (or "image/jpeg") is going to 
evaulate as TRUE, so your expression will always be true. For
example:

  var_dump((bool) "image/jpeg"); 


You should really consider using the fileinfo extension, or mabey
even  http://php.net/getimagesize.  The ['type'] information
can't be trusted to be what it says it is.

Curt.
-- 
cat .signature: No such file or directory

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux