RE: [PHP] Check the contents of a file field
| From: | Jennifer Goodie | Date: | Mon, 05 May 2003 23:36:01 +0000 |
| Subject: | RE: [PHP] Check the contents of a file field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146471@lists.php.net to get a copy of this message | ||
Well, are you posting and is your field named 'document'? Because the other
vars you are using are GETs and although you can mix GET and POST, it is not
super common and would probably be done by a higher level user for a
specific reason.
> -----Original Message-----
> From: shaun [mailto:shaun@mania.plus.com]
> Sent: Monday, May 05, 2003 4:21 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Check the contents of a file field
>
>
> Thanks for your replies Jennifer,
>
> but using this code, i still get a message saying 'Please complete all
> fields'
>
> if($_POST[document] == ''){
> $error = "Please complete all fields";
> header ("Location:
> add_document.php?error=$error&project_id=".$_GET[project_id]."&pro
> ject_name=
> ".$_GET[project_name]."");
> exit;
> }
>
> Any suggestions?
>
> "Jennifer Goodie" <goodie@apollointeractive.com> wrote in message
>
> news:NEBBIJJIKBGCCCNKMPBCOEEMHGAA.goodie@apollointeractive.com...
> > If you are checking before you submit the form, you need to use
> javascript.
> > If you are checking after the form is submitted you use PHP. The PHP
> answer
> > has already been given. The javascript way would be something like
> > if(document.forms[0].fieldname.value == ''){
> > alert "The file field was not filled out."
> > return false;
> > }
> >
> > Of course your form might not be form[0] and your field is probably not
> > called fieldname and I am not the Queen of Javascript, so
> you'll probably
> > need to test this. But it is not like this is the javascript help list,
> > anyway.
> >
> > > -----Original Message-----
> > > From: shaun [mailto:shaun@mania.plus.com]
> > > Sent: Monday, May 05, 2003 3:44 PM
> > > To: php-general@lists.php.net
> > > Subject: Re: [PHP] Check the contents of a file field
> > >
> > >
> > > Thanks for your reply, but I am actually just trying to test
> whether the
> > > field was left empty before submitting the form...
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>