本文整理匯總了PHP中captcha::get_error方法的典型用法代碼示例。如果您正苦於以下問題:PHP captcha::get_error方法的具體用法?PHP captcha::get_error怎麽用?PHP captcha::get_error使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類captcha
的用法示例。
在下文中一共展示了captcha::get_error方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: gettext
echo " <tr>\n";
echo " <td align=\"center\">\n";
echo " <table class=\"posthead\" width=\"95%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" width=\"250\">", gettext("Use text-captcha"), ":</td>\n";
echo " <td align=\"left\">", form_radio("text_captcha_enabled", "Y", gettext("Yes"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'Y'), " ", form_radio("text_captcha_enabled", "N", gettext("No"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'N' || !isset($forum_global_settings['text_captcha_enabled'])), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" width=\"270\">", gettext("Text-captcha Dir"), ":</td>\n";
echo " <td align=\"left\">", form_input_text("text_captcha_dir", isset($forum_global_settings['text_captcha_dir']) ? htmlentities_array($forum_global_settings['text_captcha_dir']) : "text_captcha", 35, 255), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan=\"2\">\n";
if (isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == "Y") {
if (!$text_captcha->generate_keys() || !$text_captcha->make_image()) {
if ($errno = $text_captcha->get_error()) {
switch ($errno) {
case TEXT_CAPTCHA_NO_FONTS:
html_display_error_msg(gettext("Text-captcha has been disabled automatically because there are no true type fonts available for it to use. Please upload some true type fonts to <b>text_captcha/fonts</b> on your server."), '95%', 'center');
break;
case TEXT_CAPTCHA_DIR_ERROR:
html_display_error_msg(gettext("Text-captcha has been disabled because the text_captcha directory and it's sub-directories are not writable by the web server / PHP process."), '95%', 'center');
break;
case TEXT_CAPTCHA_GD_ERROR:
html_display_error_msg(gettext("Text-captcha has been disabled because your server's PHP setup does not provide support for GD Image manipulation and / or TTF font support. Both are required for text-captcha support."), '95%', 'center');
break;
}
}
}
}
echo " </td>\n";
示例2: gettext
echo " <tr>\n";
echo " <td align=\"center\">\n";
echo " <table class=\"posthead\" width=\"95%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" width=\"250\">", gettext("Use text-captcha"), ":</td>\n";
echo " <td align=\"left\">", form_radio("text_captcha_enabled", "Y", gettext("Yes"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'Y'), " ", form_radio("text_captcha_enabled", "N", gettext("No"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'N' || !isset($forum_global_settings['text_captcha_enabled'])), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" width=\"270\">", gettext("Text-captcha Dir"), ":</td>\n";
echo " <td align=\"left\">", form_input_text("text_captcha_dir", isset($forum_global_settings['text_captcha_dir']) ? htmlentities_array($forum_global_settings['text_captcha_dir']) : "text_captcha", 35, 255), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan=\"2\">\n";
if (isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == "Y") {
if (!$text_captcha->generate_keys() || !$text_captcha->make_image()) {
if (($errno = $text_captcha->get_error()) !== false) {
switch ($errno) {
case TEXT_CAPTCHA_NO_FONTS:
html_display_error_msg(gettext("Text-captcha has been disabled automatically because there are no true type fonts available for it to use. Please upload some true type fonts to <b>text_captcha/fonts</b> on your server."), '95%', 'center');
break;
case TEXT_CAPTCHA_GD_ERROR:
html_display_error_msg(gettext("Text-captcha has been disabled because your server's PHP setup does not provide support for GD Image manipulation and / or TTF font support. Both are required for text-captcha support."), '95%', 'center');
break;
}
}
}
}
echo " </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan=\"2\"> </td>\n";