Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8050271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:01:33+00:00 2026-06-05T07:01:33+00:00

I have a form built in Adobe Dreamweaver. It works, but when the checkboxes

  • 0

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.

Are there any options in Dreamweaver to make the form make use of all of the checkboxes?

<?php require_once('Connections/MySQL_CSFTDB.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue   = "") 
{
  if (PHP_VERSION < 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"])) && ($_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());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="twoColLiqLtHdr.css" rel="stylesheet" type="text/css" /><!--[if lte IE 7]>
<style>
.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 */
</style>
<![endif]-->
</head>

<body>

<div class="container">
  <div class="header"><!-- end .header --></div>
  <div class="sidebar1">
     <ul class="nav">
      <li><a href="index.php">Home</a></li>
      <li><a href="#">Search</a></li>
      <li><a href="addnew.php">Add New Article</a></li>
      <li><a href="addnew.php">Article Admin.</a></li>
      <li><a href="#">Tag Admin.</a></li>
    </ul>
    <p><!-- end .sidebar1 --></p>
</div>
  <div class="content">
    <h1>Article Database</h1>
    <p>- Add a new article.</p>
    <form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
      <table width="100%" border="0" cellpadding="6">
        <tr>
          <td width="29%" align="right"><label for="articletitle">Article Title:</label>    </td>
          <td width="71%" align="left"><input name="articletitle" type="text" id="articletitle" size="50" /></td>
        </tr>
        <tr>
          <td align="right"><label for="articleorganization">Article or Organization:</label></td>
          <td align="left"><input name="articleorganization" type="text" id="articleorganization" size="50" /></td>
        </tr>
        <tr>
          <td align="right"><label for="articledate">Access Date:</label></td>
          <td align="left"><input name="articledate" type="text" id="articledate" size="50" /></td>
        </tr>
        <tr>
          <td align="right"><label for="articledescription">Article Description:</label></td>
          <td align="left"><input name="articledescription" type="text" id="articledescription" size="50" /></td>
        </tr>
        <tr>
          <td colspan="2" align="center" valign="bottom"><p>Article Tags</p></td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>

        <br />
        <label>
          <input type="checkbox" name="CheckboxGroup1" value="option 1" id="CheckboxGroup1_0" />
          Checkbox 1</label>
        <br />
        <label>
          <input type="checkbox" name="CheckboxGroup1" value="option 2" id="CheckboxGroup1_1" />
          Checkbox 2</label>
          <td align="left"><p>
            <br />
            <br />
          </p></td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td align="left"><p><br />
          </p></td>
        </tr>
        <tr>
          <td align="right">&nbsp;</td>
          <td align="left">&nbsp;</td>
        </tr>
        <tr>
          <td colspan="2" align="center" valign="middle"><input type="submit" name="submit" id="submit" value="Submit" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
  <!-- end .content --></div>
  <div class="footer">

  </div>
  <!-- end .container --></div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:01:35+00:00Added an answer on June 5, 2026 at 7:01 am
    <input type="checkbox" name="CheckboxGroup1" />
    <input type="checkbox" name="CheckboxGroup1" />
    

    Becomes

    <input type="checkbox" name="CheckboxGroup1[]" />
    <input type="checkbox" name="CheckboxGroup1[]" />
    

    You can then read the values like this:

    $selected = array();
    if (isset($_POST['CheckboxGroup1']) && is_array($_POST['CheckboxGroup1'])) {
        $selected = $_POST['CheckboxGroup1'];
    } else {
        $selected = array($_POST['CheckboxGroup1']);
    }
    

    This makes sure the $selected variable is consistently an array. To find out whether a value was checked:

    $checked = in_array('value', $selected);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a touch screen application using Windows Forms. It works great but
I am trying to submit data to a database. I have an update form
I have a form built in webmatrix that will be updating data within a
I have a form I've built in PHP and storing the form field values
I'm trying to have the action of a HTML form built when the user
i have bought a template that have built in contact form problem is that
I currently have a form built in which after validation, if errors exist, the
I have a large form built with twitter's bootstrap kit. The fields look like
I have a small form which I built mostly in interface builder: When the
I have a form that is being dynamically built depending on user selection using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.