include('mail.php'); // What email will the email be sent to? $sendingToEmail = "vikki@sandlotstudios.com"; // Live Mode sets whether the email will be sent. // Test purposes only. $liveMode = true; // If there needs to be a page redirect, set to true. $redirect = true; // Set the page to be re-directed to. $redirectPage = "index.php"; $fail = 0; if ($_POST['submit']) { $name = $_POST['name']; $comp = $_POST['company']; $email = $_POST['email']; $address1 = $_POST['address1']; $address2 = $_POST['address2']; $workPhone = $_POST['workphone']; $cellPhone = $_POST['cellphone']; $message = $_POST['message']; $valueArray = array($name, $comp, $email, $address1, $address2, $workPhone, $cellPhone, $message); for ($i = 0; $i < count($valueArray); $i++) { if ($valueArray[$i] == "" || $valueArray[$i] == " ") { $fail = 1; } } // Check to see if there weren't any errors if ($fail == 0) { $to = $sendingToEmail; $subj = "Contact For Website"; $msg = "This is an email notice from your website."; $msg .= "\n\n----------------------------------------------------------------\n\n"; $msg .= "Customer Name: \t$name\nCompany: \t$comp\nCustomer email: \t$email\nAddress1: \t$address1\nAddress2: \t$address2\nWork Phone: \t$workPhone\nCell Phone: \t$cellPhone\nMessage: \t$message"; if ($liveMode) { sendmail($to, $subj, $msg); // Re-direct page if needed if ($redirect) { header('Location: '.$redirectPage); exit(); } } // Since email was sent, clear all fields $name = ""; $comp = ""; $email = ""; $address1 = ""; $address2 = ""; $workPhone = ""; $cellPhone = ""; $message = ""; } else { $error = "Please make sure all fields are filled in."; } } ?>






