[thelist] Strange checkbox issue (PHP / Forms)

Jack Timmons jorachim at gmail.com
Wed Mar 4 07:53:07 CST 2009


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);


> 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.

And I'm assuming the problem is that he's checking boxes but nothing is
showing up there, which leads back to my original request of either
pastebin[1] code or to be able to take a look at it.

I'm thinking your script is overwriting the POST variable elsewhere.

1 - http://pastebin.com/

-- 
-Jack Timmons
http://www.trotlc.com
Twitter: @jorachim



More information about the thelist mailing list