[thelist] Strange checkbox issue (PHP / Forms)
ben morrison
morrison.ben at gmail.com
Wed Mar 4 08:37:29 CST 2009
On Wed, Mar 4, 2009 at 1:53 PM, Jack Timmons <jorachim at gmail.com> wrote:
> On Wed, Mar 4, 2009 at 7:06 AM, ben morrison <morrison.ben at gmail.com>
> wrote:
>
> > On Wed, Mar 4, 2009 at 11:06 AM, Hugh Miller <hmiller at cfpress.co.uk>
> > wrote:
> > Try adding true, so it prints out the contents:
> >
> > print_r($_POST['subsection'], true);
> >
>
> Adding "true" only makes print_r return the output, not display it. If you
> use "true", you would want to do it as so:
>
> $string - print_r($_POST,true);
>
I was talking about debugging sorry, as in
error_log(print_r($_POST['subsection'], true);
To make sure the beginning of the script is working,
> > isset() just tests to see if it 'is set' - which it is, the way you have
> > coded it.
> >
> > Maybe it would be better to test for empty:
> >
> > if (false == empty($_POST['subsection'])) {
> > //do something
> > }
> >
>
> !empty($_POST) would work just as well, to save some space.
>
Would that help to fix the problem of invalid in the loop of
$_POST['subsection'])
Surely thats where the test should be for the invalid issue.
Ben
--
Ben Morrison
More information about the thelist
mailing list