[thelist] Strange checkbox issue (PHP / Forms)

ben morrison morrison.ben at gmail.com
Wed Mar 4 07:06:25 CST 2009


On Wed, Mar 4, 2009 at 11:06 AM, Hugh Miller <hmiller at cfpress.co.uk> wrote:

>
>
> print_r($_POST['subsection']) outputs 'Array' and that is all.
>

Try adding true, so it prints out the contents:

print_r($_POST['subsection'], true);


> if(isset($_POST['subsection'])) {
>   $subsection = implode("|",$_POST['subsection']);
> }
> ***********
> I get the message "Invalid arguments". This appears to be due to
> $subSection being empty (but PHP still thinking it is an array!).

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
}

http://uk2.php.net/isset
http://uk2.php.net/empty

Ben



-- 
Ben Morrison



More information about the thelist mailing list