$width) { if(!$last_space) { $return .= $break; $count = 0; } else { $drop = $i - $last_space; if($drop > 0) { $return = mb_substr($return, 0, -$drop); } $return .= $break; $i = $last_space + ($br_width - 1); $last_space = false; $count = 0; } } $return .= mb_substr($str, $i, 1, 'UTF-8'); } return $return; } $unique_id = NULL; if(isset($_POST['form_unique_id'])){ $unique_id = $_POST['form_unique_id']; } elseif (isset($_GET['form_unique_id'])) { $unique_id = $_GET['form_unique_id']; } if ($unique_id !== NULL) { if (get_magic_quotes_gpc()) { $_SESSION = array_map('stripslashes_deep', $_SESSION); } $submitted_ids = isset($_SESSION['submitted_ids']) ? $_SESSION['submitted_ids'] : array(); if(isset($submitted_ids[$unique_id])){ header('Location: '.$_SERVER['PHP_SELF']); session_destroy(); return; } else { $submitted_ids[$unique_id] = TRUE; $_SESSION['submitted_ids'] = $submitted_ids; } } if (array_key_exists('BoatingBlog', $_POST) && (array_key_exists('', $_POST) || array_key_exists('_x', $_POST))) { $activeformname = 'BoatingBlog'; if (get_magic_quotes_gpc()) { $_POST = array_map('stripslashes_deep', $_POST); $_GET = array_map('stripslashes_deep', $_GET); $_COOKIE = array_map('stripslashes_deep', $_COOKIE); } $to = 'bill@furrelle.com'; $subject = 'Boating Blog Subscription'; $expected = array('Name', 'PostalCode', 'Email', 'Age', 'Gender', 'Boating', 'Sailing', 'TurfnSurf', 'Cruising', 'Explore', 'WeeklyDigest'); $required = array('Name', 'PostalCode', 'Email'); $emailFields = array('Email'); $useEmailFromForm = true; $missing = array(); $messages = array(); $fromEmail = ''; $suspect = false; $resultMessage = NULL; isSuspect($_POST, $suspect_pattern, $suspect); if (!$suspect) { foreach ($expected as $key) { $value = ''; if (isset($_POST[$key])) { $value = $_POST[$key]; } $temp = is_array($value) ? $value : trim($value); if (empty($temp)){ if (in_array($key, $required)) { array_push($missing, $key); } else { $messages[$key] = ''; } } else { if (in_array($key, $emailFields)) { if(!preg_match($checkEmail, $temp)) { array_push($missing, $key); } else { if ($useEmailFromForm && empty($fromEmail)){ $fromEmail = $temp; } $messages[$key] = $temp; } } else { $messages[$key] = $temp; } } } if (!empty($missing)){ $num = count($missing); if ($num == 1 && in_array($missing[0], $emailFields) && !empty($_POST[$missing[0]])) { $resultMessage = "Please enter a valid email address."; } else { $mesg = implode(", ", $missing)."."; $resultMessage = "Please complete the missing item(s): ${mesg}"; } } else { $message = ""; $newline = ""; foreach($expected as $name){ $tempvalue = $messages[$name]; if (is_array($tempvalue)){ $tempvalue = implode(", ", $tempvalue); } $message .= "${newline}${name}: $tempvalue"; $newline = "\r\n\r\n"; } $message = mb_wordwrap($message, 70); if (empty($fromEmail)){ $fromEmail = $to; } $additionalHeaders = "Content-Type: text/plain; charset=utf-8\r\n"; $additionalHeaders .= "From: $fromEmail"; $mailSent = mail($to, $subject, $message, $additionalHeaders); if ($mailSent) { unset($missing); $resultMessage = "Thank you for subscribing !"; } else { $resultMessage = ""; } } } else { unset($missing); $resultMessage = "Sorry, there was a problem sending your message. Please try later."; } } ?> H2O - Sailing Home
Sailing from H2O

The Sailing blog from H2O brings you the biggest news every week from the world of sailing.

 

Perhaps  you love a lazy weekend cruise with the family. Or maybe the sight of a foiling AC45 is more your speed. Either way you are in luck because the Sailing blog form H20 brings you everything from the world of sailing. Planning a charter ? Looking for the worlds best destinations ? Upgrading your boat or buying a new one ? Looking for news on competitions around the world ? The Sailing blog covers all this and more

 

You can subscribe to the Sailing blog and receive articles delivered to your inbox weekly or you can subscribe to the H2O Weekly Digest blog and get the best Sailing story of the week along with our other great headlines from all the H2O blogs.

Choose your subscriptions here

(We share your personal information with no one !)

/> /> /> /> /> /> /> /> /> /> />
Copyright 2012 H2O, Inc.