You are here: Re: [PHP] Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg" « PHP « IT news, forums, messages
Re: [PHP] Is there an alternative for $_FILES['guildimage']['type'] == "image/jpeg"

Posted by Curt Zirzow on 11/23/05 18:55

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация