"; // Try Header Redirect if (!headers_sent()) { header('Location: '.$location); exit; } // Header already sent. Script redir them. else { echo ''; exit; } echo ""; } /**************************** Formating Functions ****************************/ function stripalpha($string) { return preg_replace('/[^0-9\.]/i', '', $string); //return ereg_replace("[^0-9]", "", $string); //return ereg_replace("[^0-9]*.\[^0-9]*", "", $string); } function phoneFormat($sPhone,$defaultArea = '603') { $sPhone = ereg_replace("[^0-9]",'',$sPhone); if(strlen($sPhone) == 7) { $sPhone = $defaultArea.$sPhone; } $sArea = substr($sPhone,0,3); $sPrefix = substr($sPhone,3,3); $sNumber = substr($sPhone,6,4); $sPhone = "(".$sArea.") ".$sPrefix."-".$sNumber; return($sPhone); } // EMAILRIFIC TYPE FUNCTIONALITIENESS (Of Much Happy Fun Joy) // function checkValidEmail($addy) { list($userName, $mailDomain) = split("@", $addy); if(!stristr($mailDomain,'.')) { return false; } else if(checkdnsrr($mailDomain, "MX")) { return true; } else if(stristr($mailDomain, ".mx")) { return true; } else { return false; } } /**************************** End Formating Functions ****************************/ if($_POST[submit]) { if(!$_POST[first_name]) $error .= "First Name,"; if(!$_POST[last_name]) $error .= "Last Name,"; if(!$_POST[company]) $error .= "Company,"; if(!$_POST[email]) $error .= "Email Address,"; else { if(!checkValidEmail($_POST[email])) { $error .= "Email Address,"; } } if(!$_POST[marketing_method]) $error .= "What brought you to our Website?,"; //echo 'Code: '.$_SESSION[code].'
POST: '.md5($_POST[code]).'
'; if(md5($_POST[code]) != $_SESSION[code]) $error .= "Code Confirmation,"; $error = rtrim($error, ","); if(!$error) { /* OLD FORM INFO */ /* STORE CONTACT FORM IN DATABASE */ $con = mysql_connect('localhost', 'rdfcorp.com', 'void0484') or die(mysql_error()); $db = mysql_select_db('rdfcorp', $con); $sql = "INSERT INTO requests (`prefix`, `first_name`, `last_name`, `title`, `company`, `address`, `address2`, `city`, `state`, `zipcode`, `country`, `phone`, `fax`, `cell`, `email`, `send_thermometer`, `contact_engineer`, `byPhone`, `byEmail`, `mailing_list`, `marketing_method`, `comments`, `date_added`) VALUES ('".mysql_real_escape_string($_POST[prefix])."', '".mysql_real_escape_string($_POST[first_name])."', '".mysql_real_escape_string($_POST[last_name])."', '".mysql_real_escape_string($_POST[title])."', '".mysql_real_escape_string($_POST[company])."', '".mysql_real_escape_string($_POST[address])."', '".mysql_real_escape_string($_POST[address2])."', '".mysql_real_escape_string($_POST[city])."', '".mysql_real_escape_string($_POST[state])."', '".mysql_real_escape_string($_POST[zipcode])."', '".mysql_real_escape_string($_POST[country])."', '".mysql_real_escape_string(phoneFormat($_POST[phone]))."', '".mysql_real_escape_string(phoneFormat($_POST[fax]))."', '".mysql_real_escape_string(phoneFormat($_POST[cell]))."', '".mysql_real_escape_string($_POST[email])."', '1', '".$_POST[contact_engineer]."', '".$_POST[byPhone]."', '".$_POST[byEmail]."', '".$_POST[mailing_list]."', '".$_POST[marketing_method]."', '".mysql_real_escape_string($_POST[comments])."', NOW())"; //echo $sql.'
'; $res = mysql_query($sql) or die(mysql_error()); if(mysql_affected_rows() == 1) { $id = mysql_insert_id(); /* END STORE IN DB */ /* SEND EMAIL TO RDF WITH CONTACT INFORMATION */ //$rdfContact = "sensor@rdfcorp.com"; //$rdfContact = "dkleiner@rdfcorp.com"; $rdfContact = "sensor@rdfcorp.com"; $mailSubject = "RdF Web Client - DATA"; $message = ''; if($_POST[prefix]) $message .= "Prefix: ".stripslashes($_POST[prefix])." \r\n"; if($_POST[first_name]) $message .= "Name: ".stripslashes($_POST[first_name]).($_POST[last_name] ? ' '.stripslashes($_POST[last_name]) : '')." \r\n"; if($_POST[title]) $message .= "Title: ".stripslashes($_POST[title])." \r\n"; if($_POST[company]) $message .= "Company: ".stripslashes($_POST[company])." \r\n\n"; $message .= "Address: \n".($_POST[address] ? stripslashes($_POST[address])."\n" : "").($_POST[address2] ? stripslashes($_POST[address2])."\n" : "").($_POST[city] ? stripslashes($_POST[city]) : "").($_POST[state] ? ",".stripslashes($_POST[state]) : "").($_POST[zipcode] ? " ".stripslashes($_POST[zipcode]) : "")."\n".($_POST[country] ? stripslashes($_POST[country]) : "")."\r\n\n"; if($_POST[phone]) $message .= "Phone: ".phoneFormat($_POST[phone])."\r\n"; if($_POST[fax]) $message .= "Fax: ".phoneFormat($_POST[fax])."\r\n"; if($_POST[cell]) $message .= "Cell: ".phoneFormat($_POST[cell])."\r\n"; if($_POST[email]) $message .= "Email Address: ".stripslashes($_POST[email])."\r\n\n"; //$_POST[send_thermometer] if($_POST[contact_engineer]) { $message .= "Wants to be contacted by an engineer via "; if($_POST[byPhone]) $message .= "Phone, "; if($_POST[byEmail]) $message .= "Email"; $message = rtrim($message, ", ")."."; } if($_POST[mailing_list]) $message .= "\r\nWishes to be added to our Mailing List. \r\n"; if($_POST[marketing_method]) $message .= "Was brought to our website by: ".$_POST[marketing_method]." \r\n\n"; if($_POST[comments]) $message .= "Comments: \n".stripslashes($_POST[comments])."\r\n"; $message .= "\r\nView This Contact: http://www.rdfcorp.com/contact/admin/contacts.php?func=view&id=".$id." \r\n"; $headers = 'From: Website Contact' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($rdfContact, $mailSubject, $message, $headers); /* END SEND EMAIL TO RDF */ /* SEND EMAIL TO SENDER */ //$mailTo = $_POST[email]; //$mailSubject = "Thank-you for contacting RdF Corp"; //$message = "Thank you for contacting RdF! Your submission was received successfully."; /* END SEND EMAIL TO SENDER */ } mysql_close($con); /* DISPLAY THANK YOU MESSAGE doRedirect("http://www.rdfcorp.com/contact/request_sent.php"); END DISPLAY THANK YOU */ } } if($error || !$_POST[submit]) { ?> RdF | Submit a Request
RdF Corporation
Contact us: Submit a Request

Privacy Policy
Your privacy is important to us. RdF does NOT share your
information with anyone!







Contact Us / Submit Request / Site Map / Site Support
_

 

 

Some of the required fieldnames where not filled in

The form just submitted contains some fields that are required, but not filled in. The following information was missing:

    '.$errors[$i].''; } ?>
Please fill in the missing information below and try again.