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


PHP Captcha::createImage方法代码示例

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


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

示例1: getCaptcha

 public function getCaptcha()
 {
     $width = Input::get('w', 100);
     $height = Input::get('h', 25);
     $letters = Input::get('letters', 4);
     $cpa = new Captcha($width, $height, $letters);
     header("Content-Type: image/png");
     return $cpa->createImage();
 }
开发者ID:kettanyam,项目名称:20141001done,代码行数:9,代码来源:CaptchaController.php

示例2: displayAction

 /**
  * Exibe Captcha
  */
 public function displayAction()
 {
     // - Cria, gera randomico
     $captcha = new Captcha();
     $valor_captcha = $captcha->getRandCaptcha();
     // - Guarda na sessao
     //session_start();
     $_SESSION["captcha"] = $valor_captcha;
     session_write_close();
     // - Cria a imagem
     $captcha->createImage();
 }
开发者ID:brunoblauzius,项目名称:sistema,代码行数:15,代码来源:CaptchasController.php

示例3: header

<?php

//Bootstrap SPF
require 'includes/master.inc.php';
// Set the headers so the image gets created
header("Content-type:image/jpeg");
// Lets check if we should be creating a image and we will only be able to do specific types
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'captcha') {
    header("Content-Disposition:inline ;filename=captcha.jpg");
    Captcha::createImage(100, 50, 5);
}
// Wallpaper request, I will decide later if we will be allowing only registered users to download
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'get_wallpaper' && isset($_REQUEST['width']) && !empty($_REQUEST['width']) && isset($_REQUEST['height']) && !empty($_REQUEST['height']) && isset($_REQUEST['img']) && !empty($_REQUEST['img'])) {
    $img = new GD();
    set_time_limit(3600);
    $imgSaveName = str_replace('.jpg', "_wallpaper_" . $_REQUEST['width'] . "_" . $_REQUEST['height'] . ".jpg", $_REQUEST['img']);
    header("Content-Disposition:inline ;filename=" . $imgSaveName);
    $img->resizeToResolution($_REQUEST['img'], $_REQUEST['width'], $_REQUEST['height']);
}
开发者ID:repsycle,项目名称:baseline,代码行数:19,代码来源:image.php

示例4: captcha

 /**
  * 提供验证码Action
  * 
  * @access public
  * @return mixed
  */
 public function captcha()
 {
     ob_start();
     $this->layout = null;
     $w = Req::args('w') === null ? 120 : intval(Req::args('w'));
     $h = Req::args('h') === null ? 50 : intval(Req::args('h'));
     $l = Req::args('l') === null ? 4 : intval(Req::args('l'));
     $bc = Req::args('bc') === null ? array(255, 255, 255) : '#' . Req::args('bc');
     $c = Req::args('c') === null ? null : '#' . Req::args('c');
     $captcha = new Captcha($w, $h, $l, $bc, $c);
     $captcha->createImage($code);
     $this->safebox = Safebox::getInstance();
     $this->safebox->set($this->captchaKey, $code);
     ob_end_flush();
 }
开发者ID:sammychan1981,项目名称:quanpin,代码行数:21,代码来源:controller_class.php

示例5: Captcha

<?php

// This script can be used as a PNG file, and it creates session data
session_start();
require_once 'captcha_class.php';
$myCaptcha = new Captcha();
$_SESSION['hashed_phrase'] = $myCaptcha->hashedPhrase();
$myCaptcha->createImage();
开发者ID:batica81,项目名称:travel,代码行数:8,代码来源:captchacreator.php


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