Submitting PHP Arrays
Posted: Mon May 30, 2005 9:38 pm
let's say i have a group of checkboxes with the same name, 'app[]'.
if submitted, a PHP script an receive them as an array, right?
What if i want to send it again to another script? do i have to build another form and redistribute these checkbox values?
or perhaps, make a hidden field with array values...
What do you think is the best way to do this?
if submitted, a PHP script an receive them as an array, right?
Code: Select all
$appids = $_POST['app'];Code: Select all
foreach($appids as $appid){
echo "<input type=checkbox name='app[]' value=$appid>";
}Code: Select all
echo "<input type=hidden name=appids value=$appids>";