how to retrieve checked values in php
<p>I am a newbie in php.  I have a form with multiple checkbox values. I wanna retrieve the checked values and diplay these values on other php form.</p>

<p>Below is the code which works perfectly fine if we add the checkboxes without while loop.
But when added through while loop I am not able to fetch the selected items. </p>

<p><strong>xyzhtml.php</strong>(html form)</p>

<pre><code>&lt;?PHP
        require ("DBConnect.php");
        $selectQuery =mysql_query( "SELECT * FROM fruits where approved = 0");
        while($row = mysql_fetch_array($selectQuery))
        {
          $fruit_name = $row['fruit_name'];
           echo "&lt;input type=\"checkbox\" name=\"things[]\" value=\"$fruit_name\"&gt;";
           echo "&lt;br&gt;";
        }
        ?&gt;

 On click of submit I call other php clled "xyz.php".
    Below is the code used in it.

 &lt;?php

  $checkBox = $_POST['things'];

  echo $checkBox[0];
  for($i=0; $i&lt;sizeof($checkBox); $i++){

  echo($checkBox[$i]);


  }

  ?&gt;
</code></pre>

<p>Please help.
Thanks in advance.</p>
