本文整理匯總了PHP中captcha::build_captcha方法的典型用法代碼示例。如果您正苦於以下問題:PHP captcha::build_captcha方法的具體用法?PHP captcha::build_captcha怎麽用?PHP captcha::build_captcha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類captcha
的用法示例。
在下文中一共展示了captcha::build_captcha方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlentities
// Is a fatal call if user has had too many tries
login_attempt_check();
// Redirect to the page where the user came from, but not if that was the login page.
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], "action=login") === false) {
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
} else {
$redirect_url = '';
}
$captcha = '';
// Show captcha image for guests if enabled and only if we have to do
if ($mybb->settings['captchaimage'] && $do_captcha == true) {
require_once MYBB_ROOT . 'inc/class_captcha.php';
$login_captcha = new captcha(false, "post_captcha");
if ($login_captcha->type == 1) {
if (!$correct) {
$login_captcha->build_captcha();
} else {
$captcha = $login_captcha->build_hidden_captcha();
}
} elseif ($login_captcha->type == 2 || $login_captcha->type == 4) {
$login_captcha->build_recaptcha();
} elseif ($login_captcha->type == 3) {
$login_captcha->build_ayah();
}
if ($login_captcha->html) {
$captcha = $login_captcha->html;
}
}
$username = "";
$password = "";
if (isset($mybb->input['username']) && $mybb->request_method == "post") {
示例2: captcha
if ($mybb->settings['captchaimage'] && !$mybb->user['uid']) {
$correct = false;
require_once MYBB_ROOT . 'inc/class_captcha.php';
$post_captcha = new captcha(false, "post_captcha");
if ((!empty($mybb->input['previewpost']) || $hide_captcha == true) && $post_captcha->type == 1) {
// If previewing a post - check their current captcha input - if correct, hide the captcha input area
// ... but only if it's a default one, reCAPTCHA and Are You a Human must be filled in every time due to draconian limits
if ($post_captcha->validate_captcha() == true) {
$correct = true;
// Generate a hidden list of items for our captcha
$captcha = $post_captcha->build_hidden_captcha();
}
}
if (!$correct) {
if ($post_captcha->type == 1) {
$post_captcha->build_captcha();
} elseif ($post_captcha->type == 2 || $post_captcha->type == 4) {
$post_captcha->build_recaptcha();
} elseif ($post_captcha->type == 3) {
$post_captcha->build_ayah();
}
if ($post_captcha->html) {
$captcha = $post_captcha->html;
}
} else {
if ($correct && ($post_captcha->type == 2 || $post_captcha->type == 4)) {
$post_captcha->build_recaptcha();
if ($post_captcha->html) {
$captcha = $post_captcha->html;
}
} else {