Advertisement
cdsatrian

Latihan 20170119

Jan 18th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?php for ($i=1; $i < 10; $i++) { ?>
  2.   <form method="POST">
  3. <table>
  4.   <tr>
  5.     <td>
  6.       <input type="text" name="kalori[<?php echo $i; ?>]" value="<?php echo 'kalori-'.$i; ?>">
  7.     </td>
  8.     <td>
  9.       <input type="checkbox" name="tm[]" value="<?php echo $i?>"> <?php echo $i; ?>
  10.     <td>
  11.   </tr>
  12.   <?php } ?>
  13.   <tr>
  14.     <td colspan=5><input type='submit' class="btn btn-success" name='submit' value='Proses'></td>
  15.   </tr>
  16. </table>
  17. </form>
  18. <?php
  19. if(isset($_POST['tm'])){
  20. foreach($_POST['tm'] as $chk)
  21. {
  22. $rowid=$chk;
  23. $tgl=trim($_POST["kalori"][$chk]);
  24. echo "cbx ".$rowid."==".$tgl."<br>";
  25. }
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement