本文整理汇总了PHP中ReCaptcha::checkAnswer方法的典型用法代码示例。如果您正苦于以下问题:PHP ReCaptcha::checkAnswer方法的具体用法?PHP ReCaptcha::checkAnswer怎么用?PHP ReCaptcha::checkAnswer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReCaptcha
的用法示例。
在下文中一共展示了ReCaptcha::checkAnswer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validate
public function validate($retType)
{
parent::validate($retType);
copyArray($_POST, $fv, 'name', 'email', 'msg');
if (trim($fv['name']) == '') {
$rets[] = array('msg' => 'Please enter your name!', 'field' => 'name');
}
if (filter_var($fv['email'], FILTER_VALIDATE_EMAIL) === FALSE) {
$rets[] = array('msg' => 'Invalid email!', 'field' => 'email');
}
if (trim($fv['msg']) == '') {
$rets[] = array('msg' => 'Please enter your message!', 'field' => 'msg');
}
if (ReCaptcha::checkAnswer() == false && isset($retType) && $retType == RT_JSON) {
$rets[] = array('msg' => 'The reCAPTCHA wasn\'t entered correctly!', 'field' => 'recaptcha');
}
if (isset($retType) && $retType == RT_JSON && isset($rets)) return outputJson($rets);
return $rets;
}