title: Looping through HTML table checked checkboxes using php
body: <p>i have a similar thread using javascript but i found some problem and some bugs. so i changed to  php</p>
  
  <p>so far this is my code</p>
  
  <pre><code>if(!empty($_POST['check'])) {
      foreach($_POST['check'] as $check) {
          //get the html data beside the checked checkboxes
  
      }
      }else{
          echo '&lt;script language="javascript"&gt;';
          echo 'alert("Nothing checked")';
          echo '&lt;/script&gt;'; 
      }
  </code></pre>
  
  <p>and my stripped html code</p>
  
  <pre><code>&lt;tr&gt;
                                  &lt;td&gt;&lt;?php echo $r['Name'] ?&gt;&lt;/td&gt;
                                  &lt;td&gt;&lt;?php echo $r['Age'] ?&gt;&lt;/td&gt;
                                  &lt;td&gt;&lt;?php echo $r['Address'] ?&gt;&lt;/td&gt;
  
                                  &lt;td&gt;&lt;input name="check[]" type="checkbox"  &gt;&lt;/td&gt;
                              &lt;/tr&gt;
  </code></pre>
  
  <p>i wan't to get the data on the same row where a checkbox is checked. please help me. thanks</p>