Re: Problems by transfer of arrayed formfield

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



r1.php

> <form action="r2.php" method="POST">
>
> <?php
>
> for($i=1; $i<=5; $i++) {
>  echo "<input type=checkbox name=\"ids[]\" value=". $i .">";
> }
>
>
> ?>
>
> <input type="submit" value="OK" />
>
> </form>
>
r2.php

<?php

$ids = $_POST['ids'];

foreach ($ids as $i) {
 $new_ids[] = $i;
}

print_r($new_ids);


?>

..iterate trough the submited array with foreach instead of for...

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux