The form is at http://www2.otc.fsu.edu/Forms/TSR/order_form.php. Here's the first part of the processing page. When I say rejecting, I mean the page goes to the email error page, and a record is not created in the database (FileMaker Pro). When I remove the offending dashes from the "details of work" field, it works as it should. Also, I could copy and paste the information (with the dashes) into a Filemaker record after it was created without a problem, so I don't think it's a database issue.
<?php
require_once('FX.php');
require_once('server_data.php');
if ($_POST['WebValid'] == "Yes") {
function convert_smart_quotes($string)
{
$search = array(chr(145),
chr(146),
chr(147),
chr(148),
chr(150),
chr(151),
"#",
";",
"[",
"]",
"{",
"}",
"<",
">",
"=",
"URL=http://");
$replace = array("'",
"'",
'"',
'"',
" ",
" ",
"no.",
",",
"",
"",
"",
"",
"",
"equals",
"");
return str_replace($search, $replace, $string); }
$newRecordArray = array('Contact_Name' => stripslashes($POST['Contact_Name']), 'Contact_Phone' => $POST['Contact_Phone'],'Contact_Email' => $POST['Contact_Email'],'Contact_Room' => $POST['Contact_Room'],'Contact_Bldg_Unlisted' => stripslashes($POST['Contact_Bldg_Unlisted']),'Department_Unlisted' => stripslashes($POST['Department_Unlisted']),'Budget_Auth_Signature' => stripslashes($POST['Budget_Auth_Signature']),'Budget_Phone' => $POST['Budget_Phone'],'Budget_Email_Address' => $POST['Budget_Email_Address'],'Budget_Rec_DeptID' => $POST['Budget_Rec_DeptID'],'Budget_Rec_FundCode' => $POST['Budget_Rec_FundCode'],'Budget_Rec_Project' => $POST['Budget_Rec_Project'],'Budget_NR_DeptID' => $POST['Budget_NR_DeptID'],'Budget_NR_FundCode' => $POST['Budget_NR_FundCode'],'Budget_NR_Project' => $POST['Budget_NR_Project'],'Service_Bldg_Unlisted' => stripslashes($POST['Service_Bldg_Unlisted']),'Service_Location_Rm' => $POST['Service_Location_Rm'],'Customer_Description' => stripslashes($POST['Customer_Description']),'WebValid' => $_POST['WebValid']);
// configure a connection to FileMaker Server Advanced
$ordersQuery = new FX(FM_IP, FM_PORT, FM_VERSION);
// set database and layout information
$ordersQuery->SetDBData('Webtest_Forms.fp7', 'Orders_FormView');
// set database username and password
$ordersQuery->SetDBUserPass(FM_USERNAME, FM_PASSWORD);
// retrieve all records in this database available to the current user
// add parameter array for new record
$ordersQuery->AddDBParamArray($newRecordArray);
// Add pararameters for the checkboxes. This allows some to be not checked without an error.
$checkBoxes = array('BasicSvc_Features','Instrument','Number_800','Calling_Card','COS','Auth_Code','Voice Mail','VM_Passcode_Reset','Meet_Me','Cellular_Service','SCV','Video_Conference','Networking','DSL','Cable_Internet','Access_System','Budget_Info_Change','Information_Change','Wiring', 'Estimate');
foreach($checkBoxes as $checkBox) {
if(isset($POST[$checkBox])) {
$ordersQuery->AddDBParam($checkBox, $POST[$checkBox]);
}
}
// Add pararameters for the drop-down lists. This allows some to be empty without an error.
$dropBoxes = array('Contact_Bldg','Department_Name','Service_Location_Bldg','ChartField_1','ChartField_2','ChartField_3');
foreach($dropBoxes as $dropBox) {
if(isset($POST[$dropBox])) {
$ordersQuery->AddDBParam($dropBox, $POST[$dropBox]);
}
}
$orders = $ordersQuery->DoFXAction(FX_ACTION_NEW);
$orders = convert_smart_quotes($orders);
foreach ($orders as $order);
if (isset($POST['Cellular_Service'])) // Redirect browser if cell order
{
$SESSION['ON'] = $order['Order_Number'];
header("Location: http://www2.otc.fsu.edu/Forms/Cell/cellreg.php?Order_Number=".$_SESSION['ON']);
} else {
//Begin HTML email confirmation
... there's more that won't fit here. If you need to see more, let me know.