/*
#####################################################################
Copyright 2006 Roberts WebForge, Inc. - All Rights Reserved
#####################################################################
THIS COPYRIGHT INFORMATION MUST REMAIN INTACT
AND MAY NOT BE MODIFIED IN ANY WAY
#####################################################################
By installing this script you agree to accept the terms
of this Agreement. This Agreement is a legal contract, which
specifies the terms of the license and warranty limitation between
you and Roberts WebForge, Inc. You should carefully read the following
terms and conditions before installing or using this software.
Installation or use of this software indicates your acceptance of the
license and warranty limitation terms contained in this Agreement. If
you do not agree to the terms of this Agreement, promptly delete and
destroy all copies of the Software.
License to Redistribute
Distributing the software and/or documentation with other products
(commercial or otherwise) or by other than electronic means without
Roberts WebForge, Inc.'s prior written permission is forbidden.
All rights to the Roberts WebForge, Inc. software and documentation
not expressly granted under this Agreement are reserved to Roberts WebForge,
Inc.
Multiple Copies
You may use multiple copies of this script, and any purchased components
without further purchase.
Disclaimer of Warranty
THIS SOFTWARE AND ACCOMPANYING DOCUMENTATION ARE PROVIDED "AS IS" AND
WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER
WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS HARDWARE
AND SOFTWARE ENVIRONMENTS INTO WHICH THIS SOFTWARE MAY BE USED, NO WARRANTY
OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED. THE USER MUST ASSUME THE
ENTIRE RISK OF USING THIS PROGRAM. ANY LIABILITY OF ROBERTS WEBFORGE, INC.
WILL BE LIMITED EXCLUSIVELY TO PRODUCT REPLACEMENT OR REFUND OF PURCHASE
PRICE.
IN NO CASE SHALL ROBERTS WEBFORGE, INC. BE LIABLE FOR ANY INCIDENTAL,
SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS, INCLUDING, WITHOUT LIMITATION,
LOST PROFITS OR THE INABILITY TO USE EQUIPMENT OR ACCESS DATA, WHETHER SUCH
DAMAGES ARE BASED UPON A BREACH OF EXPRESS OR IMPLIED WARRANTIES, BREACH OF
CONTRACT, NEGLIGENCE, STRICT TORT, OR ANY OTHER LEGAL THEORY. THIS IS TRUE
EVEN IF ROBERTS WEBFORGE, INC. IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
IN NO CASE WILL ROBERTS WEBFORGE'S LIABILITY EXCEED THE AMOUNT OF THE
LICENSE FEE ACTUALLY PAID BY LICENSEE TO ROBERTS WEBFORGE, INC.
########################################################################
This script is provided free of charge by Roberts WebForge, Inc. You may
use and modify this script, however, you may not redistribute it or sell it.
The anti-spam module is provided for $5.99 through this URL:
http://www.robertswebforge.com/scripts/rwf_mail.shtml
The purchase price helps fund future development of this and other scripts.
Copyright 2006, Roberts WebForge, Inc.
*/
/* ------------------------------------------------------------ */
/* SCRIPT SETTINGS */
/* ------------------------------------------------------------ */
// Where's the form you want to display? This will get "loaded" and displayed
// when the script is called initially. See the sample for an example of
// how to lay this out.
$form_file = "contact-horses.htm";
// What address does the mail come from ?
$mail_from = "beth@mackenzieranch.com";
// Who gets this email? Separate multiple addresses by a comma
$mail_to = 'beth@mackenzieranch.com';
// Subject of the submitted message that comes to you
$subject = "H-M Quarter Horse Web Inquiry";
// This section handles all the incoming fields, required fields, etc.
// List each field with it's "human readable" description. Be mindful of the quotes ("). You can add and delete entries to match your form.
$fields = array();
$fields{"name"} = "NAME";
$fields{"ranch"} = "RANCH";
$fields{"address"} = "ADDRESS";
$fields{"city-state"} = "CITY-STATE";
$fields{"zip"} = "ZIP CODE";
$fields{"phone"} = "PHONE";
$fields{"cell"} = "CELL PHONE";
$fields{"email"} = "EMAIL";
$fields{"sale-catalog"} = "CATALOG";
$fields{"private-sales"} = "PRIVATE-TREATY-SALES";
$fields{"comments"} = "COMMENTS";
// Required fields - list these comma separated in quotes as shown. The script will check to make sure fields listed here are filled in.
$required_fields = array("name","city-state","email");
// Should a confirmation email be sent? If so, set this to the field name in your form, if this is empty, no confirmation is sent.
$confirmation_to = $_REQUEST[''];
// Who sends the email back to the customer?
$confirmation_from = '';
// The subject of the confirmation message
$confirmation_subject = "";
// Confirmation text to include in your email message. This file should reside // in the same directory as this script (or put in the path to where it does reside.
$confirmation_body = "confirmation.txt";
// Thank you html - path to thankyou.html - this will be loaded into the script and displayed after a successful submission.
$thank_you = "harrell-received.htm";
// Logging - make sure this directory is writable or leave blank for no logging of incoming submissions.
$log_dir = "";
// -----------------------------------------------------------------
// ANTISPAM Settings - use this is you have the anti-spamming module.
// -----------------------------------------------------------------
// Set to 1 to enable anti-spamming.
$antispam = 1;
// Name of the antispam module - only change if you rename the module file
$antispam_include = "harrell_antispam.php";
// What's the biggest answer to the equations created by the antispam
// module? The bigger the number, the *smarter* your users have to be!
$spam_max = 100;
// END ANTISPAM settings
// END Script settings.
/*-------------------------------------------------------------*/
/* DO NOT MODIFY BELOW THIS POINT! (unless you know what you are doing) */
/*-------------------------------------------------------------*/
if($_REQUEST['action'] != 'process') {
// check for anti-spam module
if(($antispam == 1) && (file_exists($antispam_include))) {
include($antispam_include);
$equation = "";
$answer = "";
new_equation($equation,$answer,$spam_max);
}
// display the form
if(file_exists($form_file)) {
include($form_file);
}
else {
print_error("Form file: $form_file does not exist");
}
}
else {
//check required fields
//
foreach($required_fields as $rf) {
if($_REQUEST[$rf] == '') {
print_error("Please fill in a value for ".$fields{$rf});
}
}
// check antispam answer (if there)
if(($antispam == 1) && (file_exists($antispam_include))) {
include($antispam_include);
if(!check_equation($_REQUEST['EQUATION'],$_REQUEST['ANSWER'])){
print_error("You answered the equation incorrectly.");
}
}
$message = "The following was submitted:\n\n";
foreach($fields as $f => $v){
$message .= sprintf("%20s: %s\n",$v,$_REQUEST[$f]);
}
// send email to internal admin
mail($mail_to, $subject, $message, "From: $mail_from\r\n");
if($log_dir != '') {
$msg_id = time();
$fp = fopen("$log_dir/$msg_id.data","w");
fwrite($fp,$message);
fclose($fp);
}
// send confirmation email
if($confirmation_to != '') {
$message = file_get_contents($confirmation_body);
mail($confirmation_to, $confirmation_subject, $message, "From: $confirmation_from\r\n");
}
// print Thank you
include($thank_you);
}
function print_error($message) {
?>
exit;
}
?>