ajax와 함께 recaptcha의 유효성을 검사하려고 시도 할 때 유일한 문제는 recapthca가 잘못 입력되었다는 것입니다. 내 코드가 무엇이 잘못되었는지 궁금합니다. 양식 페이지에 ajax 유효성 확인 recaptcha에 대한 오류
<?php
require_once('recaptcha/recaptchalib.php');
define("PUBLICKEY"," ");
define("PRIVATEKEY"," ");
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
?>success<?
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$reason = $_POST['reason'];
$header = 'From: ' . $email . " \r\n";
$msg = "Sent from: " . $name . "\r\n";
$msg .= "Email: " . $email . " \r\n";
$msg .= "Phone: " . $phone . " \r\n";
$msg .= "Contact reason:" . $reason . " \r\n";
$msg .= "Message: " . $_POST['message'] . " \r\n";
$msg .= "Date and time " . date('d/m/Y', time());
$to = '';
$subject = 'contact page';
mail($to, $subject, utf8_decode($msg), $header);
}
else
{
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
}
?>
나는이
<?php
require_once('recaptcha/recaptchalib.php');
define("PUBLICKEY","");
define("PRIVATEKEY"," ");
?>
<div id="contact-form">
<?php echo $content; ?>
<form action="#" method="POST" id="contactForm" onSubmit="return validateCaptcha()">
<div class="form">
<label for="name">Your Name: <span class="requireds">(Required)</span><br /></label>
<input id="name" name="name" class="text-input" minlength="2" />
</div>
<div class="form">
<label for="email">Your Email:<span class="requireds">(Required)</span><br /></label>
<input id="email" name="email" class=" text-input" />
</div>
<div class="form">
<label for="phone">Your Phone:<br /></label>
<input id="phone" name="phone" type="text" maxlength="200" class="text-input" />
</div>
<div class="form">
<label for="reason">Contact reason:<br /></label>
<select id="reason" name="reason" class="select">
<option>Sales question </option>
<option>Time/ Delivery</option>
<option>My existing Order</option>
<option>Technical Question</option>
<option>Revision/ Support</option>
<option>Other</option>
</select>
</div>
<div class="form">
<label for="message">Message: <span class="requireds">(Required)</span> <br /></label>
<textarea id="message" name="message" class="textarea"></textarea>
</div>
<div style="margin:10px 0; width:495px; -moz-border-radius:3px; border-radius:3px;">
<p style="color: #f14444; text-align:right; font-size:12px" id="captchaStatus"> </p>
<?php echo recaptcha_get_html(PUBLICKEY); ?>
</div>
<input type="submit" value="" class="send"/>
</form>
내가 이미 공개 키와 개인 키가 올바른지 .. 누군가가이 코드에 어떤 문제가 있는지에 대한 아이디어가 않습니다 확인 있나요?
어떤 HTML이 생성됩니까? –
무엇을 의미합니까? 미안하지만 영어 수준이 매우 낮습니다! 내가 페이지를 테스트 할 때 무엇이 잘못 되었는가? – karlelizabeth
브라우저에서 양식 페이지를 볼 때 소스를보고 그 내용을 말해주십시오 –