本文整理汇总了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();
}
示例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();
}
示例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']);
}
示例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();
}
示例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();