|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: |
<?
########################################################
# PHP Mail Function with Validation for email and phone#
########################################################
############ READ THIS FIRST ##############################
/*
In order to get this form integrated and working you'll need to insert
the right information in the right place. Wherever you see a # INSERT HERE #
is where you'll make changes in order to customize the form for your client.
It's easy, just look throught the code for: # INSERT HERE # and everything
should work nicely.
You don't have to worry about creating variables as this form loops through
all controls you add to the page and adds their key and value pairs to the
generated email. YES! It's that simple.
If you need more validation options ask for help or use dreamweaver behaviors.
*/
###########################################################
if ($_REQUEST['posted'] && isReferrerMatch()) {
# validate correct email address
if (!preg_match('/[a-z0-9\.\_\-]+\@[a-z0-9\_\-]+(.[a-z0-9\.\_\-]+)+/', $_POST['email'])) {
$msg .= "<strong>EMAIL</strong> must be a valid email address.<br>";
}
if ($msg=='') {
$DontSendKeys = array('posted','Submit','x','y');
foreach ($_POST as $key=>$value) {
if (!in_array($key,$DontSendKeys)) {
$message .= strtoupper(str_replace('_',' ',$key)).": $value<br>";
}
}
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: sales@niceinstrumentation.com' . "\r\n";
# INSERT HERE OPTIONAL #########################
// if you want a bbc send to your email address for testing, uncomment
// the next line by deleting the "//" and put in your email address.
$headers .= 'Bcc: rurth24@yahoo.com' ."\r\n";
################################################
# INSERT HERE ##################################
/*
you must uncomment the following two lines and change the value in
the $to and $subject variables in order for the form to work
*/
$subject = "Nice Instrumentation US Contact Form";
$to = "sales@niceinstrumentation.com";
################################################
send_mail($to,$subject,$message,$headers);
$msg = "Your contact information has been sent. Please allow 24-48 hours for a response.";
# INSERT HERE ##################################
/*
you must uncomment the following lines and change the location
of where you would like the page to redirect after successful
form submission.
*/
header("Location: thank-you.php");
exit;
################################################
}
}
# send mail function
function send_mail($to,$subject,$message,$headers)
{
mail($to,$subject,$message,$headers);
}
# check if form is posting to itself
function isReferrerMatch()
{
if ($_SERVER['SERVER_PORT'] == 443)
{
$http_protocol='https';
} else {
$http_protocol='http';
}
if ($_SERVER['HTTP_REFERER'] == $http_protocol.'://'.$_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])
{
return true;
} else {
return false;
}
}
?>
|
Advertisement
| Hall of Fame |