本文整理汇总了PHP中Captcha::getImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::getImage方法的具体用法?PHP Captcha::getImage怎么用?PHP Captcha::getImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Captcha
的用法示例。
在下文中一共展示了Captcha::getImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: captcha
public function captcha()
{
$captcha = new Captcha();
$captcha->getImage($this->session->getCaptcha());
}
示例2: Copyright
<?php
/*********************************************************************
captcha.php
Simply returns captcha image.
Peter Rotich <peter@osticket.com>
Copyright (c) 2006-2013 osTicket
http://www.osticket.com
Released under the GNU General Public License WITHOUT ANY WARRANTY.
See LICENSE.TXT for details.
vim: expandtab sw=4 ts=4 sts=4:
**********************************************************************/
require_once 'main.inc.php';
require INCLUDE_DIR . 'class.captcha.php';
$captcha = new Captcha(5, 12, ROOT_DIR . 'images/captcha/');
echo $captcha->getImage();
示例3: generateText
session_start();
class Captcha
{
private $text;
//construct---------------------------------------------------------------------------------------------------------------------
function __construct()
{
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------
function generateText($length)
{
$this->text = md5(microtime() * mktime());
return substr($this->text, 0, $length);
}
function getImage()
{
$text = $this->generateText(10);
$_SESSION['textCap'] = md5($text);
$captcha = imagecreatefromgif("captcha.gif");
$colText = imagecolorallocate($captcha, rand(0, 300), rand(0, 100), rand(0, 50));
for ($x = 0; $x <= 77; $x = $x + 5) {
imageline($captcha, rand(0, 100000), rand(0, 100), rand(10, 1000), rand(0, 100), $colText);
}
//imagestring($captcha,10, 50, 15,$text, $colText);
return imagegif($captcha);
}
}
$capt = new Captcha();
//header("Content-type: image/gif");
$capt->getImage();
示例4: 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');
示例5: Captcha
<?php
$oCaptcha = new Captcha($fusebox['pathAssets'] . "fonts");
if ($oCaptcha->initialize()) {
$_SESSION['SecretUserString'] = $oCaptcha->getSecretKey();
$oCaptcha->getImage();
}