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


PHP Captcha::CreateImage方法代码示例

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


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

示例1: image

 /**
  * @param $session
  */
 function image($session)
 {
     App::import('Vendor', 'Captcha', array('file' => 'captcha' . DS . 'captcha.php'));
     $captcha = new Captcha();
     $captcha->session_var = $this->sessionName . $session;
     $captcha->CreateImage();
 }
开发者ID:roae,项目名称:hello-world,代码行数:10,代码来源:captcha.php

示例2: getCaptcha

 /**
  * @brief 生成验证码
  * @return image图像
  */
 public function getCaptcha()
 {
     //清空布局
     $this->layout = '';
     //配置参数
     $width = IReq::get('w') ? IReq::get('w') : 130;
     $height = IReq::get('h') ? IReq::get('h') : 45;
     $wordLength = IReq::get('l') ? IReq::get('l') : 5;
     $fontSize = IReq::get('s') ? IReq::get('s') : 25;
     //创建验证码
     $ValidateObj = new Captcha();
     $ValidateObj->width = $width;
     $ValidateObj->height = $height;
     $ValidateObj->maxWordLength = $wordLength;
     $ValidateObj->minWordLength = $wordLength;
     $ValidateObj->fontSize = $fontSize;
     $ValidateObj->CreateImage($text);
     //设置验证码
     ISafe::set('captcha', $text);
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:24,代码来源:controller_class.php

示例3: function

<?php

$this->app->router->get('captcha/image', ['as' => 'captcha', 'middleware' => ['\\Illuminate\\Cookie\\Middleware\\EncryptCookies', '\\Illuminate\\Session\\Middleware\\StartSession'], function () {
    return \Captcha::CreateImage();
}]);
开发者ID:wicochandra,项目名称:captcha,代码行数:5,代码来源:routes.php

示例4: captcha

 /**
  * 验证码
  */
 function captcha()
 {
     // 图片大小全局配置,扩展请在此添加
     $conf = array('s' => array('width' => 250, 'height' => 40, 'minSize' => 20, 'maxSize' => 22, 'wave' => true), 'm' => array('width' => 130, 'height' => 40, 'minSize' => 14, 'maxSize' => 16, 'wave' => false), 'n' => array('width' => 100, 'height' => 30, 'minSize' => 12, 'maxSize' => 12, 'wave' => false));
     $ini = $conf['s'];
     import('@.Rover.Captcha');
     $captcha = new Captcha();
     $captcha->resourcesPath = 'wp-include/ThirdParty/Captcha';
     $captcha->width = $ini['width'];
     $captcha->height = $ini['height'];
     $captcha->fonts = array('ERASDEMI' => array('spacing' => 1, 'minSize' => $ini['minSize'], 'maxSize' => $ini['maxSize'], 'font' => 'ERASDEMI.ttf'), 'CourierNewBold' => array('spacing' => -1, 'minSize' => $ini['minSize'], 'maxSize' => $ini['maxSize'], 'font' => 'CourierNewBold.ttf'));
     $captcha->session_var = 'verification_code';
     if ($ini['wave'] == true) {
         $captcha->Yperiod = 28;
         $captcha->Yamplitude = 8;
         $captcha->Xperiod = 18;
         $captcha->Xamplitude = 4;
     } else {
         $captcha->Yperiod = 0;
         $captcha->Yamplitude = 0;
         $captcha->Xperiod = 0;
         $captcha->Xamplitude = 0;
         $captcha->im_x = 20;
     }
     $captcha->lineWidth = 1;
     $captcha->im = imagecreatefromjpeg($captcha->resourcesPath . '/bg_' . mt_rand(0, 2) . '.jpg');
     $captcha->scale = 3;
     $captcha->colors = array(array(27, 78, 181), array(19, 121, 100), array(42, 52, 64), array(128, 15, 87), array(214, 36, 7));
     // red
     $captcha->shadowColor = array(255, 255, 255);
     $captcha->CreateImage();
 }
开发者ID:wsunxa,项目名称:pdm,代码行数:35,代码来源:AccountAction.class.php

示例5: Captcha

/**
 * Script para la generaci�n de CAPTCHAS
 *
 * @author  Jose Rodriguez <jose.rodriguez@exec.cl>
 * @license GPLv3
 * @link    http://code.google.com/p/cool-php-captcha
 * @package captcha
 * @version 0.3
 *
 */
namespace Captcha;

session_start();
$captcha = new Captcha();
// Image generation
$captcha->CreateImage();
/**
 * SimpleCaptcha class
 *
 */
class Captcha
{
    /** Width of the image */
    public $width = 200;
    /** Height of the image */
    public $height = 70;
    /** Dictionary word file (empty for random text) */
    public $wordsFile = '';
    /**
     * Path for resource files (fonts, words, etc.)
     *
开发者ID:sCar-w4y,项目名称:Ilch-2.0,代码行数:31,代码来源:Captcha.php

示例6: getCaptcha

 function getCaptcha()
 {
     $width = intval(IReq::get('w')) == 0 ? 130 : IFilter::act(IReq::get('w'));
     $height = intval(IReq::get('h')) == 0 ? 45 : IFilter::act(IReq::get('h'));
     $wordLength = intval(IReq::get('l')) == 0 ? 5 : IFilter::act(IReq::get('l'));
     $fontSize = intval(IReq::get('s')) == 0 ? 25 : IReq::get('s');
     $ValidateObj = new Captcha();
     $ValidateObj->width = $width;
     $ValidateObj->height = $height;
     $ValidateObj->maxWordLength = $wordLength;
     $ValidateObj->minWordLength = $wordLength;
     $ValidateObj->fontSize = $fontSize;
     $ValidateObj->CreateImage($text);
     exit;
 }
开发者ID:snamper,项目名称:xiaoshuhaochi,代码行数:15,代码来源:method.php

示例7: Captcha

<?php

session_start();
include_once 'Captcha.php';
$captcha = new Captcha();
$_SESSION['captcha'] = $captcha->CreateImage();
开发者ID:ngothanhduoc,项目名称:wap_tao,代码行数:6,代码来源:index.php

示例8: Captcha

<?php

session_start();
require_once 'file:///C|/wamp/www/CaptchaCodeManagemant/Captcha.php';
$objCaptcha = new Captcha(60, 20);
$objCaptcha->CreateImage();
$objCaptcha->getImage();
$_SESSION["code"] = $objCaptcha->getCode();
//header('location:../CaptchaCodeManagemant/page.php');
开发者ID:harishankar121,项目名称:gitrepogit,代码行数:9,代码来源:captcha.php

示例9: getCaptcha

 /**
  * @brief 生成验证码
  * @return image图像
  */
 public function getCaptcha()
 {
     //清空布局
     $this->layout = '';
     //配置参数
     $width = intval(IReq::get('w')) == 0 ? 130 : IReq::get('w');
     $height = intval(IReq::get('h')) == 0 ? 45 : IReq::get('h');
     $wordLength = intval(IReq::get('l')) == 0 ? 5 : IReq::get('l');
     $fontSize = intval(IReq::get('s')) == 0 ? 25 : IReq::get('s');
     //创建验证码
     $ValidateObj = new Captcha();
     $ValidateObj->width = $width;
     $ValidateObj->height = $height;
     $ValidateObj->maxWordLength = $wordLength;
     $ValidateObj->minWordLength = $wordLength;
     $ValidateObj->fontSize = $fontSize;
     $ValidateObj->CreateImage($text);
     //设置验证码
     ISafe::set('Captcha', $text);
 }
开发者ID:Wen1750686723,项目名称:utao,代码行数:24,代码来源:controller_class.php


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