On Monday 21 May 2001 08:03, Heidi Belal wrote:
> I have a form where i let people choose a file to
> upload, but i want to limit them to image files only.
> So i want to only allow the .gif and .jpg to be
> uploaded. What i tried doing was this:
> if ($filename_type == "image/gif")
> -- upload file
> otherwise give an error message!
>
> but for some reason this doesn't work. It uploads any
> kind of file without complaint! So what am i doing
> wrong? Is there another operator to compare strings
> for instance? Or what is the problem?
== is perfectly fine for string comparison. Try doing a
echo "'$filename_type'";
and (generally) a phpinfo ();
to see what's passed to your script.
--
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)
Those who will not reason, are bigots,
those who cannot, are fools,
and those who dare not, are slaves.
- George Gordon Noel Byron (1788-1824), [Lord Byron]
--
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]