We love hearing from our customers. Please don't hesitate to drop us a line. And if you need to, you can send us a file (under 10MB, please). Note that all fields are required. We can't wait to hear from you!
".
"The server this script is hosted on is using PHP Version $php_version. ".
"Upgrade your server to PHP 5.2 and try again.";
array_push($errors, $php_error);
}else{
$php_check = 'good';
}
//======================================================================//
// ! CGI FIX
//======================================================================//
// Some hosts (was it GoDaddy?) complained without this
@ini_set('cgi.fix_pathinfo', 0);
//======================================================================//
// ! PHP 5.3 will complain without this
//======================================================================//
if(ini_get('date.timezone') == '') date_default_timezone_set('GMT');
// ! -- LOAD REQUIRED CLASSES
@require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR .'contact_files/formsnap/formsnap.php');
//=============================================================//
// ! - CONFIGURE SETTINGS
//=============================================================//
// ! -- GENERAL
$ydfs_settings = array(); // to hold all of our settings variables
$ydfs_settings['debug'] = false; // true or false
$ydfs_settings['base_id'] = 'stacks_in_48_page0'; // stacks id for this base
$ydfs_settings['from_email'] = 'sales@prestigepress.com';
$ydfs_settings['from_name'] = 'Prestige Press';
$ydfs_settings['reply_to_item'] = str_replace('#', '', 'email'); // must be field name
$subject_key = str_replace('#', '', 'subject');
$ydfs_settings['subject'] = (isset($_POST['form'][$subject_key]) ? $_POST['form'][$subject_key] : 'Web Form Submission');
// ! -- RECIPIENTS // comma delimited
$ydfs_settings['to'] = 'buddy@prestigepress.com,amber@prestigepress.com'; // To
$ydfs_settings['cc'] = 'sales@prestigepress.com'; // Cc
$ydfs_settings['bcc'] = ''; // Bcc
$ydfs_settings['date'] = date('r');
$ydfs_settings['encoding_method'] = 'quoted-printable'; // base64, 7bit, 8bit
$ydfs_settings['encoding_charset'] = 'utf-8';
$ydfs_settings['word_wrap'] = "50";
$ydfs_settings['success_redirect'] = true; // true or false
$ydfs_settings['success_url'] = '../';
$ydfs_settings['error_redirect'] = false; // true or false
$ydfs_settings['error_url'] = '';
// ! -- RECEIPT
$ydfs_settings['send_receipt'] = true; // true or false
$ydfs_settings['receipt_prefix'] = 'Re: '; // precedes the receipt email subject
$ydfs_settings['receipt_attachments'] = true; // true or false
// ! --SECURITY
$ydfs_settings['allowed_file_types'] = "doc|xls|pdf|jpg|jpeg|png|gif|zip|rar|gz|psd|ai|indd";
$ydfs_settings['use_captcha'] = ""; // true or false
$ydfs_settings['recaptcha_public_key'] = (('' != '') ? '' : '6LcJG8ESAAAAAH8FTVf0Sq8ePv8ienj8iGW7woC2' );
$ydfs_settings['recaptcha_private_key'] = (('' != '') ? '' : '6LcJG8ESAAAAAOt0toc-1mWqvlj7uTn9KkWkSVjp');
$ydfs_settings['max_attachment_size'] = 15000;
$ydfs_settings['max_attachment_size_bytes'] = $ydfs_settings['max_attachment_size'] * 1024; // Covert KB to bytes value
$ydfs_settings['email_filter_regexp'] = '/\r|\n|to:|cc:|bcc:|to:|cc:|bcc:/i';
// ! -- MySQL PREFS
$ydfs_settings['save_to_mysql'] = false; // true or false
$ydfs_settings['do_not_send'] = false; // true or false
$ydfs_settings['mysql_host'] = '';
$ydfs_settings['mysql_db'] = '';
$ydfs_settings['mysql_user'] = '';
$ydfs_settings['mysql_password'] = '';
$ydfs_settings['mysql_table'] = '';
// ! -- SMTP
$ydfs_settings['use_smtp'] = false;
$ydfs_settings['smtp_host'] = 'smtp.gmail.com';
$ydfs_settings['smtp_port'] = '25';
$ydfs_settings['smtp_auth'] = true; // (bool)
$ydfs_settings['smtp_username'] = 'randall@watersedgechurch.net';
$ydfs_settings['smtp_password'] = 'fa1thnus4';
$ydfs_settings['smtp_debug'] = '1';
$ydfs_settings['smtp_secure'] = false; // (bool)
$ydfs_settings['smtp_secure_prefix'] = 'SSL';
// ! -- MESSAGE STRINGS
$ydfs_settings['error_title'] = 'Error!';
$ydfs_settings['error_message'] = 'Oops! An Error Occurred.';
$ydfs_settings['success_title'] = 'Success!';
$ydfs_settings['success_message'] = 'Your Message Has Been Sent Successfully!';
$ydfs_settings['captcha_failed'] = 'Security Test Failed';
$ydfs_settings['file_too_big'] = 'Maximum File Size Exceeded.';
$ydfs_settings['file_not_allowed'] = 'Sorry, That File Type Is Not Allowed.';
$ydfs_settings['required_field_alert'] = 'One or More Required Field(s) are Missing.';
$ydfs_settings['invalid_email'] = 'Invalid Email.';
$ydfs_settings['ok_button'] = 'OK';
$ydfs_settings['redirect_message'] = 'All Good Here. You\'re Being Redirected...';
// ! -- EMAIL TEMPLATES
$ydfs_settings['email_template'] = 'From: #name# Email: #email# Phone: #phone#
Thank you for your email. Someone will be in touch with you very soon. In the meantime, if you need anything please do not hesitate to call us at 757-826-5881. We look forward to working with you. You can also find us on FACEBOOK, TWITTER, and PINTEREST.
Below is a copy of your message.
From: #name# Email: #email#
Subject: #subject# Message: #message#
***End of Message***';
$ydfs_output='{"result":"fail", "msg":"'.$ydfs_settings['error_message'].'(001)"}'; // init
//=====================================================//
// ! - POST SUBMITTED
//=====================================================//
if(
isset($_POST['ydfs_stacks_id']) && $_POST['ydfs_stacks_id'] == 'stacks_in_48_page0'
&& ( (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' )
|| ( $_POST['ydfs_xmlhttprequest'] == 'iesux' && preg_match('/(?i)msie [1-9]/',$_SERVER['HTTP_USER_AGENT'])))
):
$fs = new Formsnap;
$fs->settings = $ydfs_settings;
//=====================================================//
// ! - SECURITY CHECKS
//=====================================================//
// SPAM checking. If the "comment" form field has been filled out,
// send back to form asking to remove content and exit the script.
if ($_POST['rellikmaps']) {
array_push($errors, 'Please remove content from the last textarea before submitting the form again. This is to protect against SPAM abuse.') ;
}
//=====================================================//
// ! - SECURITY QUESTION
//=====================================================//
// Validate Security question
if (isset($_POST['security_answer']) && $ydfs_settings['use_security_question'] ) {
if(strtolower($_POST['security_answer']) != strtolower($ydfs_settings['security_answer']))
array_push($errors, $ydfs_settings['security_wrong_answer']) ;
}
//=====================================================//
// ! - CAPTCHA & VALIDATION
//=====================================================//
// ! -- reCAPTCHA CHECK
# was there a reCAPTCHA response?
if(array_key_exists('recaptcha_challenge_field', $_POST))
{
// !-- reCAPTCHA TEST
$recaptcha_result = $fs->recaptchaCheckAnswer();
if ( $recaptcha_result != 'good')
{
array_push($errors, $ydfs_settings['captcha_failed']);
}
unset($recaptcha_result);
}
// ! -- CHECK REQUIRED FIELDS
$required = $fs->checkRequiredFields();
if($required != 'good')
{
array_push($errors, $ydfs_settings['required_field_alert']);
}
// ! -- REPLY EMAIL VALIDATION
if(!$fs->validateEmail($_POST['form'][$ydfs_settings['reply_to_item']])){
array_push($errors, 'Reply-To Item "'.$ydfs_settings['reply_to_item'].'" has a value of "'.$_POST['form'][$ydfs_settings['reply_to_item']].'" which is an invalid email format. This usually happens when you assign the incorrect Item Name to the Reply-To Item setting.');
}
//=====================================================//
// ! FILTER INPUT FOR HACK ATTEMPTS
//=====================================================//
if(!empty($ydfs_settings['email_filter_regexp'])) {
foreach ($_POST['form'] as $key => $value)
{
$newValue = preg_replace( $ydfs_settings['email_filter_regexp'] ,'***',$value);
$_POST['form'][$key] = $newValue;
}
}
//=====================================================//
// ! - ATTACHMENTS
//=====================================================//
// process any attachments if present...
$files = $fs->processAttachments();
if( $files != 'good' )
array_push($errors, $files);
//=====================================================//
// ! - CUSTOM CODE
//=====================================================//
//=====================================================//
// ! - PROCESS
//=====================================================//
if (!$errors)
{
// process form...
$fs->processForm();
}
$ydfs_output = $fs->getOutput($errors, $required);
endif; // if POSTED
$ob_contents = ob_get_contents();
ob_end_clean();
if(!empty($ob_contents)) {
$ydfs_output = json_encode(array('result'=>'fail', 'msg'=>htmlspecialchars($ob_contents)));
}
?>
FormSnap Alert!
If you are seeing this, then you are likely viewing this stack in the RapidWeaver preview mode OR you have published this page as something other than the required .php page type. Fix this and republish for the stack to function properly.