當前位置: 首頁>>代碼示例>>PHP>>正文


PHP captcha::get_num_chars方法代碼示例

本文整理匯總了PHP中captcha::get_num_chars方法的典型用法代碼示例。如果您正苦於以下問題:PHP captcha::get_num_chars方法的具體用法?PHP captcha::get_num_chars怎麽用?PHP captcha::get_num_chars使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在captcha的用法示例。


在下文中一共展示了captcha::get_num_chars方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: gettext

     echo "                <tr>\n";
     echo "                  <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Confirmation"), "</td>\n";
     echo "                </tr>\n";
     echo "              </table>\n";
     echo "              <table class=\"posthead\" width=\"100%\">\n";
     echo "                <tr>\n";
     echo "                  <td align=\"center\">\n";
     echo "                    <table class=\"posthead\" width=\"95%\">\n";
     echo "                      <tr>\n";
     echo "                        <td align=\"left\" valign=\"top\" rowspan=\"2\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image to the right. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</td>\n";
     echo "                        <td align=\"left\" valign=\"top\" rowspan=\"2\">&nbsp;</td>\n";
     echo "                        <td align=\"left\" valign=\"top\"><img src=\"data:image/jpeg;base64,", base64_encode(file_get_contents($text_captcha_image)), "\" alt=\"", gettext("This is a captcha-picture. It is used to prevent automatic registration"), "\" title=\"", gettext("This is a captcha-picture. It is used to prevent automatic registration"), "\" id=\"captcha_img\" /></td>\n";
     echo "                        <td align=\"left\" valign=\"top\"><img src=\"", html_style_image('reload.png'), "\" border=\"0\" alt=\"\" class=\"text_captcha_reload\" id=\"text_captcha_reload\" /></td>\n";
     echo "                      </tr>\n";
     echo "                      <tr>\n";
     echo "                        <td align=\"left\" colspan=\"2\">", form_input_text("private_key", "", 20, htmlentities_array($text_captcha->get_num_chars()), "", "text_captcha_input"), form_input_hidden("public_key", htmlentities_array($text_captcha->get_public_key())), "</td>\n";
     echo "                      </tr>\n";
     echo "                      <tr>\n";
     echo "                        <td align=\"left\" colspan=\"2\">&nbsp;</td>\n";
     echo "                      </tr>\n";
     echo "                    </table>\n";
     echo "                  </td>\n";
     echo "                </tr>\n";
     echo "              </table>\n";
     echo "            </td>\n";
     echo "          </tr>\n";
     echo "        </table>\n";
     echo "      </td>\n";
     echo "    </tr>\n";
     echo "  </table>\n";
 }
開發者ID:richstokoe,項目名稱:BeehiveForum,代碼行數:31,代碼來源:register.php

示例2: sprintf

            if (($text_captcha_image = $text_captcha->make_image()) !== false) {
                $forum_owner_email = forum_get_setting('forum_email', 'strlen', 'admin@beehiveforum.co.uk');
                $forum_owner_link = sprintf("<a href=\"mailto:%s\">%s</a>", $forum_owner_email, gettext("forum owner"));
                echo "</div>\n";
                echo "</div>\n";
                echo "<div class=\"register\">\n";
                echo "<h3>", gettext("Confirmation"), "</h3>\n";
                echo "<div class=\"register_inner\">\n";
                //echo "  <div class=\"register_confirmation\">\n";
                echo "  <div class=\"register_confirmation\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image below. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</div>\n";
                echo "  <div class=\"register_confirmation_image\">\n";
                echo "    ", html_style_image('text_captcha_image', gettext("This is a captcha-picture. It is used to prevent automatic registration"), 'text_captcha_image', array('background-image' => sprintf("url('data:image/jpeg;base64,%s')", base64_encode(file_get_contents($text_captcha_image))), 'width' => "{$text_captcha->get_width()}px", 'height' => "{$text_captcha->get_height()}px")), "\n";
                echo "    ", html_style_image('text_captcha_reload reload', null, 'text_captcha_reload'), "\n";
                echo "  </div>\n";
                echo "  <div class=\"register_confirmation_input\">\n";
                echo "    ", light_form_input_text("private_key", null, 20, htmlentities_array($text_captcha->get_num_chars())), "\n";
                echo "  </div>\n";
                //echo "  <div class=\"clearer\"></div>\n";
                //echo "</div>\n";
            }
        }
    }
    echo "  <div class=\"register_buttons\">\n";
    echo "  ", light_form_submit('register', gettext("Register"));
    echo "  <a href=\"llogon.php?webtag={$webtag}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n";
    echo "  </div>\n";
} else {
    $forum_name = forum_get_setting('forum_name', 'strlen', 'A Beehive Forum');
    if (($forum_rules = forum_get_setting('forum_rules_message', 'strlen', false)) !== false) {
        $forum_rules = sprintf(gettext("<p><b>Forum Rules</b></p><p>Registration to %1\$s is free! We do insist that you abide by the rules and policies detailed below. If you agree to the terms, please check the 'I agree' checkbox and press the 'Register' button below. If you would like to cancel the registration, click <a href=\"index.php?webtag=%2\$s\">here</a> to return to the forums index.</p><p>Although the administrators and moderators of %1\$s will attempt to keep all objectionable messages off this forum, it is impossible for us to review all messages. All messages express the views of the author, and neither the owners of %1\$s, nor Project Beehive Forum and its affiliates will be held responsible for the content of any message.</p><p>By agreeing to these rules, you warrant that you will not post any messages that are obscene, vulgar, sexually-orientated, hateful, threatening, or otherwise in violation of any laws.</p><p>The owners of %1\$s reserve the right to remove, edit, move or close any thread for any reason.</p>"), $forum_name, $webtag);
    }
開發者ID:DeannaG65,項目名稱:BeehiveForum,代碼行數:31,代碼來源:lregister.php

示例3: captcha

         exit;
     }
     break;
 case 'reload_captcha':
     $text_captcha = new captcha(6, 15, 25, 9, 30);
     if (!$text_captcha->generate_keys()) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     if (!($text_captcha_image = $text_captcha->make_image())) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     cache_disable();
     header('Content-Type: application/json');
     $content = json_encode(array('image' => sprintf("data:image/jpeg;base64,%s", base64_encode(file_get_contents($text_captcha_image))), 'chars' => $text_captcha->get_num_chars(), 'key' => $text_captcha->get_public_key()));
     break;
 case 'font_size_larger':
 case 'font_size_smaller':
     if (!session::logged_in()) {
         break;
     }
     cache_disable();
     if (!isset($_GET['msg']) || !validate_msg($_GET['msg'])) {
         header_status(500, 'Internal Server Error');
         exit;
     }
     list($tid, $pid) = explode('.', $_GET['msg']);
     $user_prefs = user_get_prefs($uid);
     switch ($_GET['action']) {
         case 'font_size_smaller':
開發者ID:richstokoe,項目名稱:BeehiveForum,代碼行數:31,代碼來源:ajax.php


注:本文中的captcha::get_num_chars方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。