0
我是网络开发(或开发)的新手,我使用Laravel(如果它很重要)。我的形式有一个reCAPTCHA。它的工作原理,但现在我必须在验证码中验证用户的关键字。谷歌的reCAPTCHA验证
文档:https://developers.google.com/recaptcha/docs/verify听起来很简单,但不知何故,我不能写代码行进行验证。我正在寻找一些例子,但他们不是Laravel,而是纯PHP,并且我没有看到示例中使用的'https://www.google.com/recaptcha/api/siteverify?secret=your_secret&response=response_string&remoteip=user_ip_address'URL。
我的控制器:
public function postMessage() {
require_once('recaptchalib.php');
$privatekey = "MY_PRIVATE_KEY";
?????
// this should be executed only after validation
DB::table('messages')->insert(['name' => Input::get('name'),
'email' => Input::get('email'),
'message' => Input::get('message'),
'datetime' => \Carbon\Carbon::now()->toDateTimeString()]);
所以,请指导我,我怎么能拿JSON对象与响应,或者我应该怎么写,而不是?????