Re: php and forms
| From: | Chris Shiflett | Date: | Mon, 24 Mar 2003 19:58:50 +0000 |
| Subject: | Re: php and forms | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140883@lists.php.net to get a copy of this message | ||
--- Iggy <ifran@winegard.com> wrote:
> I have a html page with a whole bunch of textfields and checkboxes.
> Once the user fills out the information it is entered it is recorded
> in a mySQL db/table the problem that i am having is with the
> checkboxes. if they are checked everything works fine, but if they
> are not then I get this:
>
> Notice: Undefined index: foo
>
> how do I make this notice disappear?
You just need to adjust your expectations. Form variables that are checkboxes
are sent by the Web client if they are checked, and they are not sent by the
Web client if they are not checked.
You might want to check out the isset() function:
http://www.php.net/manual/en/function.isset.php
Chris
=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/