PHP KODU




// Script for the form has been downloaded from http://chrisplaneta.com/freebies/php_contact_form_script_with_recaptcha/

//If the form is submitted:
if(isset($_POST['submitted'])) {

//load recaptcha file
require_once('captcha/recaptchalib.php');

//enter your recaptcha private key
$privatekey = "6LcR_P0SAAAAAPn7C26ED6AcdWRsZCZynZ-xkD_7";

//check recaptcha fields
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);


//Check to see if the invisible field has been filled in
if(trim($_POST['checking']) !== '') {
$blindError = true;
} else {

//Check to make sure that a contact name has been entered
$authorName = (filter_var($_POST['formAuthor'], FILTER_SANITIZE_STRING));
if ($authorName == ""){
$authorError = true;
$hasError = true;
}else{
$formAuthor = $authorName;
};


//Check to make sure sure that a valid email address is submitted
$authorEmail = (filter_var($_POST['formEmail'], FILTER_SANITIZE_EMAIL));
if (!(filter_var($authorEmail, FILTER_VALIDATE_EMAIL))){
$emailError = true;
$hasError = true;
} else{
$formEmail = $authorEmail;
};



//Check to make sure content has been entered
$msgContent = (filter_var($_POST['formContent'], FILTER_SANITIZE_STRING));
if ($msgContent == ""){
$commentError = true;
$hasError = true;
}else{
$formContent = $msgContent;
};

// if all the fields have been entered correctly and there are no recaptcha errors build an email message
if (($resp->is_valid) && (!isset($hasError))) {
$emailTo = 'EPOSTA ADRESİNİ YAZ BURAYA'; // here you must enter the email address you want the email sent to
$subject = 'İletişim Formu: ' . $formAuthor . ' | ' . $formSubject; // This is how the subject of the email will look like
$body = "E-posta Adresi: $formEmail \n\nMesajı: $formContent \n\n$formAuthor"; // This is the body of the email
$headers = 'From: <'.$formEmail.'>' . "\r\n" . 'Reply-To: ' . $formEmail . "\r\n" . 'Return-Path: ' . $formEmail; // Email headers

//send email
mail($emailTo, $subject, $body, $headers);

// set a variable that confirms that an email has been sent
$emailSent = true;
}

// if there are errors in captcha fields set an error variable
if (!($resp->is_valid)){
$captchaErrorMsg = true;
}
}
} ?>




Mesajınız başarıyla gönderildi.
Mesajınız en kısa sürede cevaplandırılacaktır.





Tüm alanları doldurduğunuzdan emin misiniz?.





Captcha hatası. Doğrulama kodunu hatasız girdiğinizden emin olun.



// here, you set what the recaptcha module should look like
// possible options: red, white, blackglass and clean
// more infor on customisation can be found here: http://code.google.com/intl/pl-PL/apis/recaptcha/docs/customization.html
?>
<script>
var RecaptchaOptions = {
lang : 'tr',
theme : 'red'
};
</script>
// this is where the form starts
// action attribute should contain url of the page with this form
// more on that you can read here: http://www.w3schools.com/TAGS/att_form_action.asp
?>
















// this field is visible only to robots and screenreaders
// if it is filled in it means that a human hasn't submitted this form thus it will be rejected
?>





// load recaptcha file
require_once('captcha/recaptchalib.php');
// enter your public key
$publickey = " 6LcR_P0SAAAAAIhYJmTpiCmGUBBjBPVfgKDmikWP";
// display recaptcha test fields
echo recaptcha_get_html($publickey);
?>