本文整理汇总了PHP中CCaptcha::InitCode方法的典型用法代码示例。如果您正苦于以下问题:PHP CCaptcha::InitCode方法的具体用法?PHP CCaptcha::InitCode怎么用?PHP CCaptcha::InitCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCaptcha
的用法示例。
在下文中一共展示了CCaptcha::InitCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$cpt->SetLinesNumber($result["numLines"]);
$cpt->SetLineColorRGB($result["arLineColor_1"], $result["arLineColor_2"]);
$cpt->SetTextWriting($result["textAngel_1"], $result["textAngel_2"], $result["textStartX"], $result["textDistance_1"], $result["textDistance_2"], $result["textFontSize"]);
$cpt->SetTextColorRGB($result["arTextColor_1"], $result["arTextColor_2"]);
$cpt->SetWaveTransformation($result["bWaveTransformation"] === "Y");
$cpt->SetEmptyText($result["bEmptyText"] === "Y");
$cpt->SetBorderColorRGB($result["arBorderColor"]);
$cpt->SetTTFFonts($result["arTTFFiles"]);
$arChars = array();
$l = strlen($result["letters"]);
for ($i = 0; $i < $l; $i++) {
$arChars[] = substr($result["letters"], $i, 1);
}
$cpt->SetCodeChars($arChars);
$cpt->SetCode();
if ($cpt->InitCode($cpt->GetSID())) {
$cpt->Output();
} else {
$cpt->OutputError();
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
die;
}
$APPLICATION->SetTitle(GetMessage("MAIN_ADM_CAPTCHA_PAGE_TITLE"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$CAPTCHA_CODE = htmlspecialcharsbx($APPLICATION->CaptchaGetCode());
$tabControl->Begin();
?>
<script>
<?php
foreach ($arSettings as $key => $value) {
示例2: CCaptcha
if (!Defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$HTTP_ACCEPT_ENCODING = "";
$_SERVER["HTTP_ACCEPT_ENCODING"] = "";
include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
$cpt = new CCaptcha();
$cpt->setImageSize(240, 80);
$cpt->SetBorderColor(array(255, 255, 255));
$cpt->SetEllipseColor(array("#5daac9"));
$cpt->SetEllipsesNumber(6);
$cpt->textStartX = 45;
$cpt->textFontSize = 50;
if (isset($_GET["captcha_sid"])) {
if ($cpt->InitCode($_GET["captcha_sid"])) {
$cpt->Output();
} else {
$cpt->OutputError();
}
} elseif (isset($_GET["captcha_code"])) {
$captchaPass = COption::GetOptionString("main", "captcha_password", "");
if ($cpt->InitCodeCrypt($_GET["captcha_code"], $captchaPass)) {
$cpt->Output();
} else {
$cpt->OutputError();
}
} else {
$cpt->OutputError();
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";