title: passing checked checkbox value from one page to another page in php
body: <p>How to send the check box value from one page to another page in PHP? The checkbox value is fetched from database. i need to send the checked values from one page to another. Am new to php .</p>
  
  <p>page1.php</p>
  
  <pre><code>&lt;form method="post" action="setupstates.php"&gt;
    &lt;table border=".3px" id='acttable'&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;Act Name&lt;/b&gt;&lt;/td&gt;
        &lt;td colspan="5"&gt;&lt;input type='text' name="actname" size="130" required&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;b&gt;Industry Type&lt;/b&gt;&lt;/td&gt;
        &lt;td colspan="5"&gt;&lt;input type="checkbox"&gt;
          Select All Industries&lt;/td&gt;
        &lt;?php
                  $conn = get_dbconnect();
                  $sql1 = "SELECT*FROM industry";
                  $result = mysqli_query($conn, $sql1);
                  $nrows = mysqli_num_rows($result);
                  //echo $nrows;
  
                  $sql = "SELECT name FROM industry"; //selection query
                  $rs = mysqli_query($conn, $sql); //odbc_exec($conn,$sql);
                  // if(mysqli_num_rows($rs)&gt;0){
                  while ($nrows &gt; 0) {
                      echo "&lt;tr&gt;";
                      for ($i = 0; $i &lt; 5; $i++) {
                          $row = mysqli_fetch_assoc($rs);
                          echo "&lt;td&gt;&lt;input type='checkbox' name='industrytype' value='" . $row['name'] . "'/&gt;" . $row['name'];
                      }
                      $nrows = $nrows - 5;
                      echo '&lt;/tr&gt;';
                  }
                  ?&gt;
      &lt;/tr&gt;
    &lt;/table&gt;
    &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>page2.php( setupstates.php )</p>
  
  <pre><code>&lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;b&gt;Industry Type&lt;/b&gt;&lt;/td&gt;
      &lt;td&gt;&lt;input type="checkbox" value="&lt;?php print $_POST["industrytype"] ?&gt;"&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>