title: Using multiple checkboxes in a Dreamweaver form
body: <p>I have a form built in Adobe Dreamweaver. It works, but when the checkboxes are checked the last checkbox value will submit to the database. </p>
  
  <p>Are there any options in Dreamweaver to make the form make use of all of the checkboxes?</p>
  
  <pre><code>&lt;?php require_once('Connections/MySQL_CSFTDB.php'); ?&gt;
  &lt;?php
  if (!function_exists("GetSQLValueString")) {
  function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue   = "") 
  {
    if (PHP_VERSION &lt; 6) {
      $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
    }
  
    $theValue = function_exists("mysql_real_escape_string") ?     mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  
    switch ($theType) {
      case "text":
        $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
        break;    
      case "long":
      case "int":
        $theValue = ($theValue != "") ? intval($theValue) : "NULL";
        break;
      case "double":
        $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
        break;
      case "date":
        $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
        break;
      case "defined":
        $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
        break;
    }
    return $theValue;
  }
  }
  
  $editFormAction = $_SERVER['PHP_SELF'];
  if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
  }
  
  if ((isset($_POST["MM_insert"])) &amp;&amp; ($_POST["MM_insert"] == "form1")) {
    $insertSQL = sprintf("INSERT INTO articles (articletitle, articledescription) VALUES     (%s, %s)",
                         GetSQLValueString($_POST['articletitle'], "text"),
                         GetSQLValueString($_POST['articledescription'], "text"));
  
    mysql_select_db($database_MySQL_CSFTDB, $MySQL_CSFTDB);
    $Result1 = mysql_query($insertSQL, $MySQL_CSFTDB) or die(mysql_error());
  }
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;link href="twoColLiqLtHdr.css" rel="stylesheet" type="text/css" /&gt;&lt;!--[if lte IE 7]&gt;
  &lt;style&gt;
  .content { margin-right: -1px; } /* this 1px negative margin can be placed on any of the     columns in this layout with the same corrective effect. */
  ul.nav a { zoom: 1; }  /* the zoom property gives IE the hasLayout trigger it needs to     correct extra whiltespace between the links */
  &lt;/style&gt;
  &lt;![endif]--&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;div class="container"&gt;
    &lt;div class="header"&gt;&lt;!-- end .header --&gt;&lt;/div&gt;
    &lt;div class="sidebar1"&gt;
       &lt;ul class="nav"&gt;
        &lt;li&gt;&lt;a href="index.php"&gt;Home&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Search&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="addnew.php"&gt;Add New Article&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="addnew.php"&gt;Article Admin.&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="#"&gt;Tag Admin.&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
      &lt;p&gt;&lt;!-- end .sidebar1 --&gt;&lt;/p&gt;
  &lt;/div&gt;
    &lt;div class="content"&gt;
      &lt;h1&gt;Article Database&lt;/h1&gt;
      &lt;p&gt;- Add a new article.&lt;/p&gt;
      &lt;form action="&lt;?php echo $editFormAction; ?&gt;" id="form1" name="form1" method="POST"&gt;
        &lt;table width="100%" border="0" cellpadding="6"&gt;
          &lt;tr&gt;
            &lt;td width="29%" align="right"&gt;&lt;label for="articletitle"&gt;Article Title:&lt;/label&gt;    &lt;/td&gt;
            &lt;td width="71%" align="left"&gt;&lt;input name="articletitle" type="text" id="articletitle" size="50" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&lt;label for="articleorganization"&gt;Article or Organization:&lt;/label&gt;&lt;/td&gt;
            &lt;td align="left"&gt;&lt;input name="articleorganization" type="text" id="articleorganization" size="50" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&lt;label for="articledate"&gt;Access Date:&lt;/label&gt;&lt;/td&gt;
            &lt;td align="left"&gt;&lt;input name="articledate" type="text" id="articledate" size="50" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&lt;label for="articledescription"&gt;Article Description:&lt;/label&gt;&lt;/td&gt;
            &lt;td align="left"&gt;&lt;input name="articledescription" type="text" id="articledescription" size="50" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td colspan="2" align="center" valign="bottom"&gt;&lt;p&gt;Article Tags&lt;/p&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&amp;nbsp;&lt;/td&gt;
  
          &lt;br /&gt;
          &lt;label&gt;
            &lt;input type="checkbox" name="CheckboxGroup1" value="option 1" id="CheckboxGroup1_0" /&gt;
            Checkbox 1&lt;/label&gt;
          &lt;br /&gt;
          &lt;label&gt;
            &lt;input type="checkbox" name="CheckboxGroup1" value="option 2" id="CheckboxGroup1_1" /&gt;
            Checkbox 2&lt;/label&gt;
            &lt;td align="left"&gt;&lt;p&gt;
              &lt;br /&gt;
              &lt;br /&gt;
            &lt;/p&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;td align="left"&gt;&lt;p&gt;&lt;br /&gt;
            &lt;/p&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;td align="left"&gt;&amp;nbsp;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td colspan="2" align="center" valign="middle"&gt;&lt;input type="submit" name="submit" id="submit" value="Submit" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
        &lt;input type="hidden" name="MM_insert" value="form1" /&gt;
      &lt;/form&gt;
    &lt;!-- end .content --&gt;&lt;/div&gt;
    &lt;div class="footer"&gt;
  
    &lt;/div&gt;
    &lt;!-- end .container --&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>