"yourname@yourdomain.com", "Business Proposition" => "yourname@yourdomain.com", "Request Consultation" => "yourname@yourdomain.com", "Other" => "yourname@yourdomain.com" ); //enter blocked ip addresses below separated by commas $BlockedIP = "1.1.1.1"; //enter blocked email addresses below between the quotes $BlockedEmail = "someone@aol.com, spammer@aol.com"; //Sonic Version $sonic_ver = "1.0.1"; //1.0.1 added security and routing function valid_email($email) { // Check for a valid email address. $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,6})$"; // Get the hostname. $fromHost = explode("@", $_POST['email']); // Test for both valid syntax and a valid server. if ( !eregi($regexp, $_POST['email']) || !checkdnsrr($fromHost[1], "MX") ) { return false; }else{ return true; } } if($_POST["step"] == "send"){ $send_email = "yes"; //lets try to make it no //no name, you can't contact us without a name if(!$_POST["name"]){ $send_email = "no"; $error_message_name = "
Please enter your name below.
"; } //contact pref is phone but no phone number entered if($_POST["contact_preference"] == "phone" && !$_POST["phone"]){ $send_email = "no"; $error_message_phone = "
You chose phone as your contact preference, but you did not enter your phone number. Please enter it now.
"; } if($_POST["rc"] != $_POST["rc2"]){ $send_email = "no"; $error_message_security = "
Your security characters did not match ours. Please try again.
IP Address Logged As: $REMOTE_ADDR
"; } //check for valid email format if (!valid_email($email)){ $send_email = "no"; $error_message_email = "
Your email address appears invalid. Please re-enter it below.
"; } //check for blocked ips $sonicx = strstr($BlockedIP, getenv('REMOTE_ADDR')); if($sonicx == TRUE){ $send_email = "no"; $error_message .= "
Sorry but we could not process your form at this time.
"; $error_type = "fatal"; } $sonicxemail = @strstr($BlockedEmail, $_POST["email"]); //echo "Post email =". $_POST["email"]; //echo "sonicxemail =". $sonicxemail; if($sonicxemail == TRUE){ $send_email = "no"; $error_message .= "
Sorry but we could not process your form at this time."; $error_type = "fatal"; } if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"]) && ($send_email == "yes")){ //start formatting and building the message // handle post strings reset($_POST); while(list($key, $val) = each($_POST)) { $GLOBALS[$key] = $val; if (is_array($val)) { $sonicMessage .= "$key: "; foreach ($val as $vala) { $vala =stripslashes($vala); $vala = htmlspecialchars($vala); $sonicMessage .= "$vala, "; } $sonicMessage .= "
\n"; }else{ $val = stripslashes($val); if (($key == "Submit") || ($key == "submit")){ }else{ if ($val == ""){ $sonicMessage .= "$key: -
\n"; }else{ $sonicMessage .= "$key: $val
\n"; } } } } // end while //determine the mail routing foreach($SubjectArray as $key=>$val){ if($_POST["subject"] == $key){ $MailToAddress = $val; } //end if } //end foreach $sonicMessage .= "

\n Sender IP: ".getenv('REMOTE_ADDR')."
"; $sonic_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/"); $name = preg_replace($sonic_what, "", $name); $email = preg_replace($sonic_what, "", $email); $sonicMessage = preg_replace($sonic_what, "", $sonicMessage); if (!$email) { $email = $MailToAddress; } // end if no email $mailHeader = "From: $name <$email>\r\n"; $mailHeader .= "Reply-To: $name <$email>\r\n"; $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n"; $mailHeader .= "MIME-Version: 1.0\r\n"; $mailHeader .= "Content-Type: multipart/alternative;"; $mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n"; $mailHeader .= "X-Priority: 3\r\n"; $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n"; $mailHeader .= "X-MimeOLE: Produced By SonicFog Contact Form Ver $sonic_ver\r\n"; $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n"; $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n"; $mailMessage .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"; $mailMessage .= strip_tags($sonicMessage)."\r\n\r\n"; $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n"; $mailMessage .= "Content-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n"; $mailMessage .= "$sonicMessage\r\n\r\n"; $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n"; if(!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)){ //everything worked but the mail function echo "Error sending e-mail! Please try again later."; }else{ //success message ?>

Dear
We have received your message below and will take appropriate action as soon as possilbe.
Thank you,


Your Message:
".$error_message."
"; }else{ ?>
Your name: ">
Your email: ">
Your phone: ">
Select subject :
How would you
prefer to be contacted?

Message:
Security:
Please enter the
characters you see:
   

                                                        license number:  TALCA26327C

Regulated by the Texas Department of Licensing and Registration, PO Box 12157, Austin, Texas 78711 1/800-803-9202

 







1





Authorized Dealer2





3



Generation Services 2007
Small Business Website Design