|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-03-10 13:17 UTC] cyborg at driverheaven dot net
when posting information through a form, using an array for a name, example: 4 inputs: <input name="checkbox[70]" type="checkbox" /> (where 70 is different for each input, according to the messageid) PHP gives the value 'Array' for $_POST['checkbox'], and it is a string, as print_r() displays 'Array', and is_array() returns false on check. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 15 21:00:01 2025 UTC |
I need to know how to use an array of checkboxes and find out if these checkboxes are on or off. cyborg will you please post your code. Here is how i am creating my checkboxes. $tmps = getforumtemplates(); if(!is_array($tmps)) { print "<br><br>Their are no templates defined. If you would like to enter one please click on Add New link.\n"; ?> <br> <?php }//end if else { $number = 0; $arr = array(); print "Template Name:<br>"; foreach($tmps as $t) {?> <input type="checkbox" name="templates[]"> <?=$t->name?><font size = "-1"> <a href="modifyforumtemplates.php?tid=<?=$t->templateid?>">modify</a></font><br> <?php $number++; } //end foreach } //end else