$message";
$pageTitle = "Unknown - There was a problem";
$cms_access = "cms_other";
$menu = "";
}
// Start Page Specific Variables and Functions
require_once($path . 'common/php/recaptchalib.php');
$publickey = "6LczGbsSAAAAAKKbX3xSN_bHU68aNcYJQ2IteAlO";
$formdata = $_POST["submitted"] == "yes" ? processMMForm($path) : array();
$recipient_query = "SELECT email FROM gs_recipients WHERE category_id = 275";
$recipient_result = executeSQLStatement($link, $recipient_query, array(), false);
if(!$recipient_result) {
$recipient = "communications@girlscoutsla.org";
} else {
$recipient_row = $recipient_result['result']->fetch();
$recipient = $recipient_row[0];
}
// End Page Specific Variables and Functions
// Start CMS Variables and Functions
$userid = ValidateCMSLogin($link, "none");
$tinyMCE_Script = $userid == 0 ? "" : "";
//End CMS Variables and Functions
?>
GSGLA :
array(), "error" => array());
// Fill array with submitted values:
foreach ($_POST as $key => $value) {
$formdata["value"][$key] = $value;
}
// Load reCAPTCHA response into appropriate array field
$formdata["value"]["recaptcha_challenge_field"] = $resp;
// Check required fields:
$required = $_POST["required"];
$required_fields = explode(",", $required);
$error_count = 0;
foreach ($required_fields as $field) {
$value = $_POST[$field];
if (empty($value) || ($value == "")) {
$formdata["error"][$field] = "required";
$error_count++;
}
if ($captcha == true) {
if ($field == "recaptcha_challenge_field" && !$resp->is_valid) {
$formdata["error"]["recaptcha_challenge_field"] = "The words above were not entered correctly. Please try again.";
$error_count++;
}
}
}
// If there are no errors so far, upload the image
if ($error_count == 0) {
// Upload Image Process
$img_file_type = array("image/jpeg", "image/pjpeg", "image/gif", "image/png");
$img_file_size = 1048576;
$image_result = UploadFile($link, $img_file_type, $img_file_size, "image_upload", "/home/girlscou/public_html/images/troop_news/", false);
$formdata["value"]["image_upload"] = $image_result[2];
if($image_result[0] == 2) {
foreach($image_result[1] AS $img_error){
$formdata["error"]["image_upload"] .= $img_error . " | ";
}
$error_count++;
}
}
if ($error_count > 0) {
$formdata["error"]["message"] = "
There are problems with your submission, please see specifics in red below.
";
}
// If there are no errors, email the form data to the recipient
if ($error_count == 0) {
$redirect = $_POST["redirect"];
$notify = $_POST["notify"] . "," . $_POST["email"];
$subject = $_POST["subject"];
$email_content = "
";
foreach ($_POST as $key => $value) {
// Skip special fields:
if ($key != "required" && $key != "redirect" && $key != "notify" && $key != "subject" && $key != "submitform" && $key != "recaptcha_challenge_field" && $key != "recaptcha_response_field" && $key != "pass_through") {
// Handle other special fields:
if ($key == "us_state") {
if ($_POST["country_list"] == "USA") {
$email_content .= "
$key:
$value
";
}
} else if ($key == "canadian_province") {
if ($_POST["country_list"] == "Canada") {
$email_content .= "