Re: Check the contents of a file field
| From: | Shaun | Date: | Tue, 06 May 2003 10:06:48 +0000 |
| Subject: | Re: Check the contents of a file field | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146500@lists.php.net to get a copy of this message | ||
"John W. Holmes" <holmes072000@charter.net> wrote in message
news:000a01c31376$77be6160$7c02a8c0@coconut...
> > I am trying to check whether the contents of a file field is empty but
> the
> > following code doesnt work:
> >
> > if(isset($_POST[file]) == ''){
> > $error = "Please select a document to add to the project";
> > //etc
> >
> > could someone explain my error here please?
>
> Umm... how about empty()?
>
> If(empty($variable))
> { echo "ummm... variable is empty"; }
>
> ---John W. Holmes...
>
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/
>
>
Thanks for your reply John,
but using this:
if(empty($_POST[document])){
PHP says that the file field is empty even when it isnt...