本文整理匯總了PHP中Utility::CaptchaCheck方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utility::CaptchaCheck方法的具體用法?PHP Utility::CaptchaCheck怎麽用?PHP Utility::CaptchaCheck使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Utility
的用法示例。
在下文中一共展示了Utility::CaptchaCheck方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
public function index()
{
if ($_POST) {
if (!Utility::CaptchaCheck($this->_post('verifycode'))) {
Session::Set("error", "驗證碼有誤,請重新輸入");
redirect("/login");
}
$email = $this->_get("email");
$password = $this->_get("password");
$users = D('Users');
$login_user = $users->getLogin($_POST['email'], $_POST['password']);
if (!$login_user) {
Session::Set('error', '用戶名或密碼錯誤');
$this->redirect("/frontend/login/index");
} else {
if ($login_user['is_enabled'] == 'N' && $login_user['secret']) {
Session::Set('error', '登錄失敗');
$this->redirect("/frontend/login/index");
} else {
if (abs(intval($_POST['auto_login']))) {
Login::Logon($login_user, true);
} else {
Login::Logon($login_user);
}
Session::set("success", "登錄成功");
if ($_REQUEST['ref']) {
redirect($_REQUEST['ref']);
} else {
redirect("/");
}
}
}
} else {
$this->display();
}
}
示例2: submit_contact
public function submit_contact()
{
$captcha = $this->_param("captcha");
$subscribe = $this->_param("subscribe");
if (!Utility::CaptchaCheck($captcha, true)) {
Session::Set("error", L("captcha_error"));
$this->display("error");
return;
}
$subscriberModel = M("Subscribers");
if ($subscriberModel->create()) {
$intrest = $this->_param("intrest");
if ($intrest) {
$subscriberModel->intrest = implode(",", $intrest);
}
$subscriberModel->create_time = time();
$id = $subscriberModel->add();
//send email
$contact = $this->_param("contact");
if ($contact) {
// $name = $this->_param("name");
//如果聯係方式是郵箱,就給對方發一封郵件
if (is_email($contact)) {
$email_content = D("Options")->getOption("reply_email_content" . $this->lang);
$email_title = D("Options")->getOption("reply_email_title" . $this->lang);
Mailer::SmtpMail(null, array($contact), $email_title, $email_content);
}
}
if ($subscribe) {
$title = L('subscribe_success');
} else {
$title = L('submit_success');
}
$this->assign('title', $title);
$this->display("subscribe_success");
}
}
示例3: submit_forget_password
public function submit_forget_password()
{
$email = $this->_param("email");
if (!Utility::CaptchaCheck($this->_post('verifycode'))) {
Session::Set("error", "驗證碼有誤,請重新輸入");
redirect("/register/forget_password");
}
if ($email) {
$user = D("CmsUsers")->where(array("email" => $email))->find();
if ($user) {
$subject = D("Options")->getOption("verify_email_subject");
$repasscode = md5(generate_password());
D("CmsUsers")->where(array('id' => $user['id']))->setField("repasscode", $repasscode);
$link = D("Options")->getOption("webroot_apply") . "/register/verify_repass?id=" . Crypt::en($user['id']) . "&repasscode={$repasscode}";
$link = "<a href='{$link}'>" . $link . "</a>";
$subject = D("Options")->getOption("repass_email_subject");
$content = D("Options")->getOption("repass_email_content");
$content = str_replace("[#link#]", $link, $content);
Mailer::SmtpMail(null, $email, $subject, $content);
redirect("/register/submit_forget_password_result?token=" . Crypt::en($email));
} else {
Session::Set("error", "無此郵箱");
redirect("/register/forget_password");
}
} else {
Session::Set("error", "無此郵箱");
redirect("/register/forget_password");
}
}
示例4: json
}
}
json($html, 'dialog');
} else {
json('captcha_again();', 'eval');
}
} else {
if ('subscribe' == $action) {
$html = render('ajax_dialog_smssub');
json($html, 'dialog');
} elseif ('subscribecheck' == $action) {
$mobile = trim(strval($_GET['mobile']));
$verifycode = trim(strval($_GET['verifycode']));
$city_id = abs(intval($_GET['city_id']));
$secret = Utility::VerifyCode();
if (Utility::CaptchaCheck($verifycode)) {
if (ZSMSSubscribe::Create($mobile, $city_id, $secret) === true) {
$html = render('ajax_dialog_smssuc');
} else {
$html = render('ajax_dialog_smscode');
sms_secret($mobile, $secret, true);
}
json($html, 'dialog');
} else {
json('captcha_again();', 'eval');
}
} else {
if ('codeyes' == $action) {
$mobile = trim(strval($_GET['mobile']));
$secretcode = trim(strval($_GET['secretcode']));
$sms = Table::Fetch('smssubscribe', $mobile, 'mobile');
示例5: verify_captcha
function verify_captcha($reason = 'none', $rurl = null)
{
if (option_yes($reason, false)) {
$v = strval($_REQUEST['vcaptcha']);
if (!$v || !Utility::CaptchaCheck($v)) {
Session::Set('error', '驗證碼不匹配,請重新輸入');
redirect($rurl);
}
}
return true;
}