We've been using the MySQLi Server Behaviors to insert data from our Contact form on our website for sometime with no problems. Yesterday I added a checkbox to the form named "emailReceive" for our contacts to check if they wish to receive email communicat
You can see the behavior by going to http://www.abilityconnectiontexas.org and clicking the "CONTACT US" link on the nav bar. Fill out and submit the form on the CONTACT US form that appears on the megamenu. Everything will behave as expected on the front end, but the checkbox data is not inserted on the database. I've attached a screenshot of the Column Bindings tab in the Server Behavior and a screenshot of the test results as they appear in PHPMySQLAdmin when browsing the table data. The code in the page related to this issue is shown below:
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$InsertQuery = new WA_MySQLi_Query($actdb);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "visitors";
$InsertQuery->bindColumn("firstname", "s", "".($rsContacts->getColumnVal("contactFirstName")) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("lastname", "s", "".($rsContacts->getColumnVal("contactLastName")) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("fullname", "s", "".((isset($_POST["name"]))?$_POST["name"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("email", "s", "".((isset($_POST["email"]))?$_POST["email"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("emailReceive", "c", "".((isset($_POST["emailReceive"]))?$_POST["emailReceive"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("status", "i", "4", "WA_DEFAULT");
$InsertQuery->bindColumn("regDate", "t", "".((isset($_POST["regDate"]))?$_POST["regDate"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("sourceSiteID", "i", "".((isset($_POST["pgSrc"]))?$_POST["pgSrc"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("sourceSiteName", "s", "".($rsContacts->getColumnVal("contactDeptName")) ."", "WA_DEFAULT");
$InsertQuery->saveInSession("visitorID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>
Thanks again for your help!
enthusiastically,
Mark