Please enter your name.
"; } if (!preg_match("/^[0-9a-zA-ZÄÜÖ_.-]+@[0-9a-z.-]+\.[a-z]{2,6}$/", $email)) { $fehler['email'] = "Please enter a e-mail-address.\n
"; } if(!$subject) { $fehler['subject'] = 'Please enter a subject.
'; } if(!$message) { $fehler['message'] = 'Please enter a message.
'; } if($sicherheits_eingabe != $_SESSION['captcha_spam']){ unset($_SESSION['captcha_spam']); $fehler['captcha'] = "You entered a wrong code.
"; } if (!isset($fehler) || count($fehler) == 0) { $error = false; $errorMessage = ''; $uploadErrors = array(); $uploadedFiles = array(); $totalUploadSize = 0; if ($cfg['UPLOAD_ACTIVE'] && in_array($_SERVER['REMOTE_ADDR'], $cfg['BLACKLIST_IP']) === true) { $error = true; $fehler['upload'] = 'You have no authorization to upload files.
'; } if (!$error) { for ($i=0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) { if ($_FILES['f']['error'][$i] == UPLOAD_ERR_NO_FILE) { continue; } $extension = explode('.', $_FILES['f']['name'][$i]); $extension = strtolower($extension[count($extension)-1]); $totalUploadSize += $_FILES['f']['size'][$i]; if ($_FILES['f']['error'][$i] != UPLOAD_ERR_OK) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; switch ($_FILES['f']['error'][$i]) { case UPLOAD_ERR_INI_SIZE : $uploadErrors[$j]['error'] = 'the file is too big (PHP-Ini directive).'; break; case UPLOAD_ERR_FORM_SIZE : $uploadErrors[$j]['error'] = 'the file is too big (MAX_FILE_SIZE in HTML-Formular).'; break; case UPLOAD_ERR_PARTIAL : if ($cfg['UPLOAD_ACTIVE']) { $uploadErrors[$j]['error'] = 'the file has been uploaded partially.'; } else { $uploadErrors[$j]['error'] = 'the file has been sent partially.'; } break; case UPLOAD_ERR_NO_TMP_DIR : $uploadErrors[$j]['error'] = 'No temporarily folder has been found.'; break; case UPLOAD_ERR_CANT_WRITE : $uploadErrors[$j]['error'] = 'error during saving the file.'; break; case UPLOAD_ERR_EXTENSION : $uploadErrors[$j]['error'] = 'unknown error due to an extension.'; break; default : if ($cfg['UPLOAD_ACTIVE']) { $uploadErrors[$j]['error'] = 'unknown error on uploading.'; } else { $uploadErrors[$j]['error'] = 'unknown error on sending the email attachments.'; } } $j++; $error = true; } else if ($totalUploadSize > $cfg['MAX_ATTACHMENT_SIZE']*1024) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; $uploadErrors[$j]['error'] = 'maximum upload reached ('.$cfg['MAX_ATTACHMENT_SIZE'].' KB).'; $j++; $error = true; } else if ($_FILES['f']['size'][$i] > $cfg['MAX_FILE_SIZE']*1024) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; $uploadErrors[$j]['error'] = 'The file is too big (max. '.$cfg['MAX_FILE_SIZE'].' KB).'; $j++; $error = true; } else if (!empty($cfg['BLACKLIST_EXT']) && strpos($cfg['BLACKLIST_EXT'], $extension) !== false) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; $uploadErrors[$j]['error'] = 'the file extension is not permitted.'; $j++; $error = true; } else if (preg_match("=^[\\:*?<>|/]+$=", $_FILES['f']['name'][$i])) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; $uploadErrors[$j]['error'] = 'invalid symbols in the file name (\/:*?<>|).'; $j++; $error = true; } else if ($cfg['UPLOAD_ACTIVE'] && file_exists($cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i])) { $uploadErrors[$j]['name'] = $_FILES['f']['name'][$i]; $uploadErrors[$j]['error'] = 'the file already exist.'; $j++; $error = true; } else { if ($cfg['UPLOAD_ACTIVE']) { move_uploaded_file($_FILES['f']['tmp_name'][$i], $cfg['UPLOAD_FOLDER'].'/'.$_FILES['f']['name'][$i]); } $uploadedFiles[] = $_FILES['f']['name'][$i]; } } } if ($error) { $errorMessage = 'following errors occured when sending the contact formular:'."\n"; if (count($uploadErrors) > 0) { foreach ($uploadErrors as $err) { $tmp .= ''.$err['name']."
\n- ".$err['error']."

\n"; } $tmp = "

\n".$tmp; } $errorMessage .= $tmp.''; $fehler['upload'] = $errorMessage; } } // if no error, an email will be sent if (!isset($fehler)) { // header of the email $recipient = "".$empfaenger.""; $subject = "".$_POST["subject"].""; //$mailheaders = "From: \"".stripslashes($_POST["vorname"])." ".stripslashes($_POST["name"])."\" <".$_POST["email"].">\n"; //$mailheaders .= "Reply-To: <".$_POST["email"].">\n"; //$mailheaders .= "X-Mailer: PHP/" . phpversion() . "\n"; $mailheader_betreff = "=?UTF-8?B?".base64_encode($subject)."?="; $mailheaders = array(); $mailheaders[] = "MIME-Version: 1.0"; $mailheaders[] = "Content-type: text/plain; charset=utf-8"; $mailheaders[] = "From: =?UTF-8?B?".base64_encode(stripslashes($_POST["name"]))."?= <".$_POST["email"].">"; $mailheaders[] = "Reply-To: <".$_POST["email"].">"; $mailheaders[] = "Subject: ".$mailheader_betreff; $mailheaders[] = "X-Mailer: PHP/".phpversion(); // display of the email $msg = "The following has been sent by the contact form:\n" . "-------------------------------------------------------------------------\n\n"; $msg .= "Name: " . $name . "\n"; $msg .= "E-Mail: " . $email . "\n\n"; $msg .= "Phone Number: " . $phonenumber . "\n"; $msg .= "Place: " . $place . "\n"; $msg .= "\nSubject: " . $subject . "\n"; $msg .= "Message:\n" . $_POST['message'] = preg_replace("/\r\r|\r\n|\n\r|\n\n/","\n",$_POST['message']) . "\n\n"; "-------------------------------------------------------------------------\n\n"; if (count($uploadedFiles) > 0) { if ($cfg['UPLOAD_ACTIVE']) { $msg .= 'The following files have been uploaded:'."\n"; foreach ($uploadedFiles as $file) { $msg .= ' - '.$cfg['DOWNLOAD_URL'].'/'.$cfg['UPLOAD_FOLDER'].'/'.$file."\n"; } } else { $msg .= 'The following files have been attached:'."\n"; foreach ($uploadedFiles as $file) { $msg .= ' - '.$file."\n"; } } } $msg .= "\n\nIP address: " . $ip . "\n"; //$mailheaders = "From: \"".stripslashes($_POST["vorname"])." ".stripslashes($_POST["name"])."\" <".$_POST["email"].">\n"; //$mailheaders .= "Reply-To: <".$_POST["email"].">\n"; //$mailheaders .= "X-Mailer: PHP/" . phpversion() . "\n"; $mailheader_betreff = "=?UTF-8?B?".base64_encode($subject)."?="; $mailheaders = array(); // Arrange the email attachments // is only necessary if no upload is desired if (!$cfg['UPLOAD_ACTIVE'] && count($uploadedFiles) > 0) { $attachments = array(); for ($i = 0; $i < $cfg['NUM_ATTACHMENT_FIELDS']; $i++) { if ($_FILES['f']['name'][$i] == UPLOAD_ERR_NO_FILE) { continue; } $attachments[] = $_FILES['f']['tmp_name'][$i]; } $boundary = md5(uniqid(rand(), true)); // Header $mailheaders[] = "MIME-Version: 1.0"; $mailheaders[] = "Content-type: multipart/mixed; boundary=\"".$boundary."\""; $mailheaders[] = "From: =?UTF-8?B?".base64_encode(stripslashes($_POST["name"]))."?= <".$_POST["email"].">"; $mailheaders[] = "Reply-To: <".$_POST["email"].">"; $mailheaders[] = "Subject: ".$mailheader_betreff; $mailheaders[] = "X-Mailer: PHP/".phpversion(); // Message $mailheaders[] = "--".$boundary; $mailheaders[] = "Content-type: text/plain; charset=utf-8"; $mailheaders[] = "Content-Transfer-Encoding: 8bit"; $mailheaders[] = "The following has been sent by the contact form:\n"; $mailheaders[] = $msg; $mailheaders[] = ""; // Attachment for ($i = 0; $i < count($uploadedFiles); $i++) { $file = fopen($attachments[$i],"r"); $content = fread($file,filesize($attachments[$i])); fclose($file); $encodedfile = chunk_split(base64_encode($content)); $mailheaders[] = "--".$boundary; $mailheaders[] = "Content-Disposition: attachment; filename=\"".$uploadedFiles[$i]."\""; $mailheaders[] = "Content-Type: application/octet-stream; name=\"".$uploadedFiles[$i]."\""; $mailheaders[] = "Content-Transfer-Encoding: base64"; $mailheaders[] = ""; $mailheaders[] = $encodedfile; } $mailheaders[] = "--".$boundary."--"; } else{ $mailheaders[] = "MIME-Version: 1.0"; $mailheaders[] = "Content-type: text/plain; charset=utf-8"; $mailheaders[] = "From: =?UTF-8?B?".base64_encode(stripslashes($_POST["name"]))."?= <".$_POST["email"].">"; $mailheaders[] = "Reply-To: <".$_POST["email"].">"; $mailheaders[] = "Subject: ".$mailheader_betreff; $mailheaders[] = "X-Mailer: PHP/".phpversion(); } // Thank you E-Mail $dsubject = "Your request"; // Subject of the message //$dmailheaders = "From: ".$ihrname." <".$recipient.">\n"; //$dmailheaders .= "Reply-To: <".$recipient.">\n"; $dmailheader_dsubject = "=?UTF-8?B?".base64_encode($dsubject)."?="; $dmailheaders = array(); $dmailheaders[] = "MIME-Version: 1.0"; $dmailheaders[] = "Content-type: text/plain; charset=utf-8"; $dmailheaders[] = "From: =?UTF-8?B?".base64_encode($ihrname)."?= <".$recipient.">"; $dmailheaders[] = "Reply-To: <".$recipient.">"; $dmailheaders[] = "Subject: ".$dmailheader_dsubject; $dmailheaders[] = "X-Mailer: PHP/".phpversion(); $dmsg = "Thank you very much for your e-mail. We will reply as fast as we can.\n\n"; $dmsg .= "Summary: \n" . "-------------------------------------------------------------------------\n\n"; $dmsg .= "Name: " . $name . "\n"; $dmsg .= "E-Mail: " . $email . "\n\n"; $dmsg .= "Phone Number: " . $phonenumber . "\n"; $dmsg .= "Place: " . $place . "\n"; $dmsg .= "\nSubject: " . $subject . "\n"; $dmsg .= "Message:\n" . str_replace("\r", "", $message) . "\n\n"; if (count($uploadedFiles) > 0) { $dmsg .= 'You have assigned the following files:'."\n"; foreach ($uploadedFiles as $file) { $dmsg .= ' - '.$file."\n"; } } $dmsg = strip_tags ($dmsg); //if (mail($recipient,$betreff,$msg,$mailheaders)) { //mail($email, $dsubject, $dmsg, $dmailheaders); if (mail($recipient, $mailheader_betreff, $msg, implode("\n", $mailheaders))) { mail($email, $dmailheader_dsubject, $dmsg, implode("\n", $dmailheaders)); // thank you page, if email has been sent echo ""; exit; } } } ?> Contact Us | Bali Mandira Beach Resort & Spa

Contact us

BALI MANDIRA BEACH RESORT & SPA
Postal Address: Jl. Padma No.2 - Legian, Kuta - Bali - Indonesia
Phone: : +62 361 751381
Fax : +62 361 752377

E-mail : info@balimandira.com

Message Form

Security-Code reload security code
Jl. Padma No.2 - Legian, Kuta - Bali - Indonesia | Phone : +62 361 751381 Fax : +62-361-766251
Copyright © 2013. Bali Mandira Beach Resort & Spa .:. All rights reserved