我正在尝试在网站上设置recaptcha。我以前做过这个,但我不知道为什么这不起作用。
以下是表格:
<form method="POST" action="emailProcess.php">
<label for="fullName">First and Last Name</label>
<br/>
<input id="fullName" type="text" name="fullName" required>
<br/><br/>
<label for="email">Email</label>
<br/>
<input id="email" type="text" name="email" required>
<br/><br/>
<label for="eventDate">Event Date</label>
<br/>
<input id="eventDate" type="text" name="eventDate">
</div>
<div class="contactRight">
<label for="eventTime">Event Time</label>
<br/>
<input id="eventTime" type="text" name="eventTime">
<br/><br/>
<label for="eventLocation" style="margin-top:5px;">Event Location</label>
<br/>
<input id="eventLocation" type="text" name="eventLocation">
<br/><br/>
<label for="servicesRequested" style="margin-top:5px;">Service(s) Requested</label>
<br/>
<input id="servicesRequested" type="text" name="servicesRequested">
<br/><br/>
</div>
<label for="howHear" style="margin-top:20px">How did you hear about us?</label>
<textarea class="howHear" id="howHear" name="howHear" rows="4" cols="59"></textarea>
<br/>
<label for="comment" style="margin-top:20px">Extra Comments</label>
<textarea class="comment" id="comment" name="comment" rows="4" cols="59"></textarea>
<br/><br/>
<div class="g-recaptcha" data-sitekey="my-sitekey-is-here"></div>
<br/>
<input class="submitButton" type="submit" value="Send Message">
<button class="resetButton" type="reset" value="Reset Form">Reset Form</button>
</form>
我将其包含在页面的标题中:<script src='https://www.google.com/recaptcha/api.js'></script>
在我尝试回显$_POST['g-recaptcha-response'];
页面完全空白的页面上发送此信息。