title: How to get value of checked checkbox in php?
body: <p>Here's the code:</p>
  
  <pre><code>&lt;?php // operator Page
  include ("classes/dbhelper.php");
  include ("conf/conf.php");
  $conf = new Dbconf();
  $dbURL = $conf-&gt;get_databaseURL();
  $dbUName = $conf-&gt;get_databaseUName();
  $dbPword = $conf-&gt;get_databasePWord();
  $dbName = $conf-&gt;get_databaseName();
  $nameOfDbWithCustomers = $conf-&gt;get_tableName('customer');
  
  if(isset($_REQUEST[session_name()]))
  {
     session_start();
  }
  else
  {
     header("Location: authorize.php");
  }
  if($_SESSION['usr_id'] == md5(crypt($_SESSION['login'],$_SESSION['pass'])))
  {   
      echo "&lt;script type='text/javascript' src='/jquery-1.6.js'&gt;&lt;/script&gt;
          &lt;form method='post'&gt; 
          Name: &lt;input type='text' name='Name' size='10' value=''&gt;
          Post: &lt;input type='text' name='Post' size='10' value=''&gt;
          Section: &lt;input type='text' name='Section' size='10' value=''&gt;
          Company: &lt;input type='text' name='Company' size='10' value=''&gt;
          Phone Number: &lt;input type='text' name='Phone_Number' size='10 value=''&gt;
          e-mail: &lt;input type='text' name='e-mail' size='10' value=''&gt;
          Active: &lt;input type='checkbox' name='Active' value=''&gt; 
          &lt;input type='submit' name='Search' size='10' value='Search'&gt; &lt;br&gt;
          &lt;input type='reset' name='Reset' value='Reset'&gt;
          &lt;/form&gt;
  
          &lt;form method ='post'&gt;
          SMS: &lt;input type='checkbox' name = 'sms'&gt;
          E-mail: &lt;input type='checkbox' name = 'email' id='mailcheck'&gt;&lt;br&gt;
          &lt;TEXTAREA NAME='message' WRAP='virtual' COLS='40' ROWS='3'&gt;
          &lt;/TEXTAREA&gt;&lt;br&gt;
          &lt;input type ='submit' name ='Send' size = '10' value = 'Send'&gt;
          &lt;/form&gt;
  
          &lt;form action='upload.php'' method='post' enctype='multipart/form-data'&gt;
          &lt;input type='file' name='filename'&gt;&lt;br&gt; 
          &lt;input type='submit value='Загрузить'&gt;&lt;br&gt;
          &lt;/form&gt;";
  
      if (isset($POST['Send'])){
  
      }
  
      if (isset($_POST['Search'])){
          //*********************query*************************
          $name = isset($_POST['Name']) ? $_POST['Name'] : 0;
          $post = isset($_POST['Post']) ? $_POST['Post'] : 0;
          $section = isset($_POST['Section']) ? $_POST['Section'] : 0;
          $company = isset($_POST['Company']) ? $_POST['Company'] : 0;
          $phoneNumber = isset($_POST['Phone_Number']) ? $_POST['Phone_Number'] : 0;
          $eMail = isset($_POST['e-mail']) ? $_POST['e-mail'] : 0;
          $active = isset($_POST['Active']) ? "1" : "0";
  
          $array = array(
                   "name" =&gt; $name,
                   "post" =&gt; $post,
                   "section" =&gt; $section,
                   "company" =&gt; $company,
                   "phone_number" =&gt; $phoneNumber,
                   "email" =&gt; $eMail,
                   "status" =&gt; $active
                 );
  
          $sql = "SELECT * FROM $nameOfDbWithCustomers";
          $sql_where = array();
  
          foreach($array as $key =&gt; $value)
              {
                  if(!empty($value))
                  $sql_where[] = $key." = "."'$value'";
              }
          if(count($sql_where) &gt; 0)
              {
                  $sql .=" WHERE ";
              }
          $sql.=" ".implode(" AND ", $sql_where);
          //*********************END query*************************
          $dbHelp = new DbHelper($dbURL, $dbUName, $dbPword, $dbName, '');
          $queryResult = $dbHelp-&gt;getDataFromDbByQuery($sql); 
  
          $table = "&lt;table border=1 width=100% align=center&gt;\n";
          $table .= "&lt;tr&gt;\n";
          $i = 1;
          while ($i &lt; mysql_num_fields($queryResult)) {
              $meta = mysql_fetch_field($queryResult, $i);
              $i++;
              $table .= "&lt;td&gt;".$meta-&gt;name."&lt;/td&gt;\n";
          }
          $table .= "&lt;td&gt; Выбрать все: &lt;input type='checkbox' name='cbname3[]' value='main' id='chkSelectAll'&lt;/td&gt;\n";
          $table .= "&lt;/tr&gt;\n";
          $i = 1;
          while ($row = mysql_fetch_assoc($queryResult)){     
              $table .= "&lt;tr&gt;\n";
              $table .= "&lt;td&gt;".$row['name']."&lt;/td&gt;\n";
              $table .= "&lt;td&gt;".$row['post']."&lt;/td&gt;\n";    
              $table .= "&lt;td&gt;".$row['section']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['company']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['phone_number']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['email']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['status']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['lock_time']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;".$row['reason_for_blocking']."&lt;/td&gt;\n";  
              $table .= "&lt;td&gt;&lt;input type='checkbox' class=".check."  name='cbname3[]' id='chkItems' value=".$row['id']." /&gt;&lt;/td&gt;";
              $table .= "&lt;/tr&gt;\n";
              $i++;
          }
          $table .= "&lt;/table&gt;\n";
          echo $table;
      }
  }
  
  ?&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function() {
          $("#&lt;%=chkSelectAll.ClientID %&gt;").click(function() {
              $("#&lt;%= chkItems.ClientID %&gt; input:checkbox").attr('checked',this.checked);
          });
  
          $("#&lt;%=chkItems.ClientID %&gt; input:checkbox").click(function(){
            if($("#&lt;%= chkSelectAll.ClientID %&gt;").attr('checked') == true &amp;&amp; this.checked == false)
               $("#&lt;%= chkSelectAll.ClientID %&gt;").attr('checked',false);
  
               if(this.checked == true)
                  CheckSelectAll();
          });
  
        function checkSelectAll()
        {
            var flag = true;
             $("#&lt;%=chkItems.ClientID %&gt; input:checkbox").each(function() {
                  if(this.checked == false)
                      flag = false;
              });
                $("#&lt;%= chkSelectAll.ClientID %&gt;").attr('checked',flag);
        }  
      });
  </code></pre>
  
  <p></p>
  
  <p>I want to get value of checked checkbox from table when user press on "send" button. How can I do that?</p>