当前位置: 首页>>代码示例>>PHP>>正文


PHP Captcha::render方法代码示例

本文整理汇总了PHP中Captcha::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::render方法的具体用法?PHP Captcha::render怎么用?PHP Captcha::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Captcha的用法示例。


在下文中一共展示了Captcha::render方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_default

 /**
  * 输出缩略图
  */
 public function action_default($type = '')
 {
     $width = 80;
     $height = 30;
     if ($type && preg_match('#^([0-9]+)x([0-9]+)$#i', $type, $m)) {
         if ($m[1] > 0) {
             $width = $m[1];
         }
         if ($m[1] > 0) {
             $height = $m[2];
         }
     }
     Captcha::render(array('width' => $width, 'height' => $height));
 }
开发者ID:xiaodin1,项目名称:myqee,代码行数:17,代码来源:captcha.controller.php

示例2: captcha

 /**
  * Demontrates how to use the Captcha library.
  */
 public function captcha()
 {
     // Look at the counters for valid and invalid
     // responses in the Session Profiler.
     new Profiler();
     // Load Captcha library, you can supply the name
     // of the config group you would like to use.
     $captcha = new Captcha();
     // Ban bots (that accept session cookies) after 50 invalid responses.
     // Be careful not to ban real people though! Set the threshold high enough.
     if ($captcha->invalid_count() > 49) {
         exit('Bye! Stupid bot.');
     }
     // Form submitted
     if ($_POST) {
         // Captcha::valid() is a static method that can be used as a Validation rule also.
         if (Captcha::valid($this->input->post('captcha_response'))) {
             echo '<p style="color:green">Good answer!</p>';
         } else {
             echo '<p style="color:red">Wrong answer!</p>';
         }
         // Validate other fields here
     }
     // Show form
     echo form::open();
     echo '<p>Other form fields here...</p>';
     // Don't show Captcha anymore after the user has given enough valid
     // responses. The "enough" count is set in the captcha config.
     if (!$captcha->promoted()) {
         echo '<p>';
         echo $captcha->render();
         // Shows the Captcha challenge (image/riddle/etc)
         echo '</p>';
         echo form::input('captcha_response');
     } else {
         echo '<p>You have been promoted to human.</p>';
     }
     // Close form
     echo form::submit(array('value' => 'Check'));
     echo form::close();
 }
开发者ID:AsteriaGamer,项目名称:steamdriven-kohana,代码行数:44,代码来源:examples.php

示例3: testRender

 /**
  * @covers Xoops\Form\Captcha::render
  * @covers Xoops\Form\Captcha::__construct
  */
 public function testRender()
 {
     $value = $this->object->render();
     $this->assertTrue(is_string($value));
 }
开发者ID:ming-hai,项目名称:XoopsCore,代码行数:9,代码来源:CaptchaTest.php

示例4: Captcha

<?php

/**
 * This script generates an image containing an asymmetric key used by login.
 *
 * @author    Richard K. Szabó <richard@9eb.se>
 * @file      verify.php
 * @copyright MIT
 */
$auto_login = false;
require "../../include/iq.php";
$captcha = new Captcha(10);
$session->set(Captcha::KEY_LOGIN, $captcha->getCode(), Captcha::LIFETIME_LOGIN);
$captcha->render();
开发者ID:rszabo,项目名称:egalite,代码行数:14,代码来源:verify.php

示例5: array

echo $this->Form->Input('PasswordMatch', 'password', array('Wrap' => TRUE));
echo '<span id="PasswordsDontMatch" class="Incorrect" style="display: none;">' . t("Passwords don't match") . '</span>';
?>
            </li>
            <?php 
$this->fireEvent('ExtendedRegistrationFields');
?>
            <li>
                <?php 
echo $this->Form->label('Why do you want to join?', 'DiscoveryText');
echo $this->Form->textBox('DiscoveryText', array('MultiLine' => true, 'Wrap' => TRUE));
?>
            </li>

            <?php 
Captcha::render($this);
?>

            <?php 
$this->fireEvent('RegisterFormBeforeTerms');
?>

            <li>
                <?php 
echo $this->Form->CheckBox('TermsOfService', $TermsOfServiceText, array('value' => '1'));
?>
            </li>
            <li class="Buttons">
                <?php 
echo $this->Form->button('Apply for Membership', array('class' => 'Button Primary'));
?>
开发者ID:R-J,项目名称:vanilla,代码行数:31,代码来源:registerapproval.php

示例6: action_index

 public function action_index()
 {
     Captcha::render();
 }
开发者ID:ariol,项目名称:adminshop,代码行数:4,代码来源:Captcha.php


注:本文中的Captcha::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。