예제 #1
0
 public function captcha()
 {
     $captcha = new Captcha();
     $captcha->getImage($this->session->getCaptcha());
 }
예제 #2
0
<?php

/*********************************************************************
    captcha.php

    Simply returns captcha image.
    
    Peter Rotich <*****@*****.**>
    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
0
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
0
<?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
0
<?php

$oCaptcha = new Captcha($fusebox['pathAssets'] . "fonts");
if ($oCaptcha->initialize()) {
    $_SESSION['SecretUserString'] = $oCaptcha->getSecretKey();
    $oCaptcha->getImage();
}