function PPA($str)
{
$str = str_replace("\\'","'",$str);
$str = str_replace("\\\"","\"",$str);
$str = str_replace("\\\\","\\",$str);
return $str;
}
function checkmail($email)
{
if(filter_var($email, FILTER_VALIDATE_EMAIL))
{
if ( function_exists("getmxrr") )
if ( getmxrr(substr(strstr($email, '@'), 1), $validate_email_temp) ) {
return TRUE;
}
if ( function_exists("checkdnsrr") )
if ( checkdnsrr(substr(strstr($email, '@'), 1),"ANY") ){
return TRUE;
}
if ( !function_exists("getmxrr") && !function_exists("checkdnsrr") )
return TRUE;
}
return FALSE;
}
?>
session_start();
if (!isset($_SESSION[$captchaText])) $_SESSION[$captchaText] = $$captchaText;
if (!isset($_SESSION[$captchaEntered])) $_SESSION[$captchaEntered] = $$captchaEntered;
$valid=0;
if($_POST['validsubmit']=='1')
{
$valid=1;
$salutation = $_POST['salutation'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$company = $_POST['company'];
$street = $_POST['street'];
$city = $_POST['city'];
$telephone = $_POST['telephone'];
$email = $_POST['email'];
$enquiry = $_POST['enquiry'];
$comments = $_POST['comments'];
$nospam = $_POST['nospam'];
if($salutation==''){ $salutation_error = '!'; $valid=0; }
if($firstname==''){ $firstname_error = '!'; $valid=0; }
if($lastname==''){ $lastname_error = '!'; $valid=0; }
if($email=='' || !checkmail($email)){ $email_error = '!'; $valid=0; }
if($_SESSION['captchaEntered'] == 1) ;
else if($nospam==''){ $nospam_error = '!'; $valid=0; }
else if(strcasecmp(PPA($nospam),$_SESSION['captchaText'])!=0){ $nospam_error = '!'; $valid=0; }
else $_SESSION['captchaEntered'] = 1;
}
if($valid)
{
$nl = "\r\n";
$to = 'office@hjkcon.com';
$subject = mb_encode_mimeheader('Anfrage via Web-Formular', 'ISO-8859-1', 'Q');
$mail_from_name = mb_encode_mimeheader('Kontaktformular auf hjkcon.com', 'ISO-8859-1', 'Q');
$mail_from_adress = 'message@hjkcon.com';
$message = ' '.$nl.
'Salutation: '.utf8_decode($salutation).$nl.
'First name: '.utf8_decode($firstname).$nl.
'Last name: '.utf8_decode($lastname).$nl.
'Company:'.utf8_decode($company).$nl.
'Street:'.utf8_decode($street).$nl.
'City:'.utf8_decode($city).$nl.
'Telephone:'.utf8_decode($telephone).$nl.
'Email: '.utf8_decode($email).$nl.
'Enquiry:'.utf8_decode($enquiry).$nl.
'Comments:'.$nl.utf8_decode($comments).$nl.$nl.
'Sender: '.$_SERVER["REMOTE_ADDR"].$nl.
'Zeitpunkt: '.date("Y.m.d H:i:s").$nl.
' ';
$attach = '';
if (is_uploaded_file($_FILES['document']['tmp_name']))
$attach .= shell_exec('/usr/bin/uuencode '.$_FILES['document']['tmp_name'].' "'.$_FILES['document']['name'].'"');
if($attach!='') $attach = "\n\n\n".$attach;
mail($to, $subject, $message.$attach, "From: $mail_from_name <$mail_from_adress>\nSent-For: $mail_from_name <$mail_from_adress>\nX-Mailer: PHP/" . phpversion() . "\nErrors-To: $mail_from_adress", "-F$mail_from_name -f$mail_from_adress");
//mail($to, $subject, $message.$attach, "From: $mail_from_name <$mail_from_adress>\nBCC: $bcc\nSent-For: $mail_from_name <$mail_from_adress>\nX-Mailer: PHP/" . phpversion() . "\nErrors-To: $mail_from_adress", "-F$mail_from_name -f$mail_from_adress");
echo "
Connect With Us
Contact Us Today For More Info: +43 664 8872 7465
Your Partner in Iran business: