本文整理汇总了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";