public function getAgnomen() { $this->load->library('session'); $this->load->library('ValidateCode'); $_vc = new ValidateCode(); $_vc->doimg(); $this->session->set_userdata('authnum_session', $_vc->getCode()); }
/** * 生成验证码 * Enter description here ... */ function create_Code() { $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $this->session->set_userdata('code', $_vc->getCode()); //验证码保存到SESSION中 }
public function captcha() { import('ORG.Util.ValidateCode'); $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['verify'] = strtolower($_vc->getCode()); //验证码保存到SESSION中 }
$bgcolor = imagecolorallocate($im, 235, 236, 237); //画背景 imagefilledrectangle($im, 0, 0, $w, $h, $bgcolor); //画边框 imagerectangle($im, 0, 0, $w - 1, $h - 1, $gray); //imagefill($im, 0, 0, $bgcolor); //在画布上随机生成大量点,起干扰作用; for ($i = 0; $i < 80; $i++) { imagesetpixel($im, rand(0, $w), rand(0, $h), $black); } //将字符随机显示在画布上,字符的水平间距和位置都按一定波动范围随机生成 $strx = rand(3, 8); for ($i = 0; $i < $num; $i++) { $strpos = rand(1, 6); imagestring($im, 5, $strx, $strpos, substr($code, $i, 1), $black); $strx += rand(8, 14); } imagepng($im); imagedestroy($im); } //获取验证码 public function getCode() { return strtolower($this->code); } } $ValidateCode = new ValidateCode(); $ValidateCode->doimg(); session_start(); $_SESSION['authnum_session'] = $ValidateCode->getCode();
/** * * 验证码 */ function verifCode() { session_start(); $this->doNotRenderHeader = 1; $vc = new ValidateCode(); //实例化一个对象 //$vc->setFonts('BambergOutline-Regular.ttf'); //$vc->setFonts('sketchy.ttf'); $vc->getCodeImg(); $_SESSION['verifCode'] = $vc->getCode(); //echo $_vc->getInfo(); }
<?php /** * @author ChenHaihong * @desc 生成验证码图片 * */ session_start(); require '../ValidateCode.class.php'; //先把类包含进来,实际路径根据实际情况进行修改。 $_vc = new ValidateCode(); //实例化一个对象 $_vc->render(); $_SESSION['auth_code_session'] = $_vc->getCode(); //验证码保存到SESSION中
<?php defined('SYSPATH') or die('No direct script access.'); require MODPATH . 'admin.captcha' . EXT; //$captcha= SimpleCaptcha::instance()->CreateImage(); $captchacalss = new ValidateCode(); $captchacalss->doimg(); session_start(); $_SESSION['captcha'] = $captchacalss->getCode();
public function codeAction() { $this->view->disable(); $vcode = new ValidateCode(); $vcode->doimg(); $this->session->set('code', $vcode->getCode()); }
<?php header("content-type:image/png"); session_start(); require_once 'class.ValidateCode.php'; $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['authnum'] = $_vc->getCode(); //验证码保存到SESSION中
<?php session_start(); require 'ValidateCode.class.php'; //先把类包含进来,实际路径根据实际情况进行修改。 $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['authnum_session'] = $_vc->getCode(); //验证码保存到SESSION中
<?php session_start(); //session_destroy(); if (isset($_GET['check'])) { echo $_SESSION['author_code']; } else { require "./ValidateCode.php"; $vcode = new ValidateCode(); $vcode->doimg(); $_SESSION['author_code'] = $vcode->getCode(); }
<?php require './engine/validatecode.php'; session_start(); $vcode = new ValidateCode('./font/LHANDW.TTF'); $vcode->doimg(); $_SESSION['validatecode'] = $vcode->getCode();
function onget_code() { require TIPASK_ROOT . '/lib/validatecode/validatecode.class.php'; //先把类包含进来,实际路径根据实际情况进行修改。 $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['code'] = $_vc->getCode(); //验证码保存到SESSION中 }
/** * * 验证码 */ function verifCode() { session_start(); $this->doNotRenderHeader = 1; $_vc = new ValidateCode(); //实例化一个对象 $_vc->setFonts('AGENTORANGE.TTF'); $_vc->setSize(90, 36); $_vc->getCodeImg(); $_SESSION['verifCode'] = $_vc->getCode(); //验证码保存到SESSION中 }
public function validateCode() { $code = new ValidateCode(); $code->showimg(); $_SESSION['validateCode'] = strtolower($code->getCode()); }
<?php session_start(); include dirname(__FILE__) . '/ValidateCode.php'; $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['validate_code'] = $_vc->getCode();
require_once __DIR__ . '/validateCode/ValidateCode.class.php'; /*$x = 120; $y = 28; $im = @imagecreatetruecolor($x, $y); if(empty($im)) { exit(); } $trans = imagecolorallocatealpha($im, 255, 255, 255 , 127); imagecolortransparent($im, $trans); imagefilledrectangle($im, 0, 0, $x, $y, $trans); for($i = 0; $i < $x; $i++) { $p = 255 - $i; $line = imagecolorallocatealpha($im, $p, $p, $p, 0); imagefilledrectangle($im, $i, 0, $i + 1, $y, $line); } $letters = random(4, true); $hash = md5($letters . $_W['config']['setting']['authkey']); isetcookie('__code', $hash); $fontColor = imagecolorallocatealpha($im, 40, 40, 40, 0); $len = strlen($letters); for($i = 0; $i < $len; $i++) { imagestring($im, 5, 35 + $i * 15, 3 + rand(0, 10), $letters[$i], $fontColor); } header('content-type: image/png'); imagepng($im); imagedestroy($im);*/ $_vc = new ValidateCode(); //实例化一个对象 $_vc->render(); $hash = md5($_vc->getCode() . $_W['config']['setting']['authkey']); isetcookie('__code', $hash);
<?php require 'captcha.class.php'; session_start(); $vc = new ValidateCode(); $vc->doimg(); $vcodes = $vc->getCode(); //生成验证码图片 Header("Content-type:image/PNG"); $_SESSION['Checknum'] = $vcodes;
public function validateCode() { $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['code'] = $_vc->getCode(); }
<?php require 'ValidateCode.class.php'; session_start(); $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['yzm'] = $_vc->getCode(); //验证码保存到SESSION中
/** * PAGE: index * This method handles what happens when you move to http://yourproject/songs/index */ public function index() { session_start(); //require dirname(__DIR__) . '/controller/ValidateCode/ValidateCode.class.php'; //先把类包含进来,实际路径根据实际情况进行修改。 $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['authnum_session'] = $_vc->getCode(); //验证码保存到SESSION中 }
* You should have received a copy of the GNU Affero General Public License * along with WEIPDCRM. If not, see <http://www.gnu.org/licenses/>. */ session_cache_expire(30); session_cache_limiter("private"); session_start(); session_regenerate_id(true); define('ROOT_PATH', dirname(__FILE__)); define('ABSPATH', dirname(ROOT_PATH) . '/'); if (isset($_GET['authpic'])) { if (trim($_GET['authpic']) == 'png') { define('IN_DCRM', true); include_once ABSPATH . 'system/class/validatecode.php'; $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['VCODE'] = $_vc->getCode(); exit; } else { exit; } } else { $localetype = 'manage'; include_once ABSPATH . 'system/common.inc.php'; header("Cache-Control: no-store"); } if (!isset($_SESSION['try'])) { $_SESSION['try'] = 0; } elseif (isset($_SESSION['lasttry']) && $_SESSION['lasttry'] + DCRM_LOGINFAILRESETTIME <= time()) { $_SESSION['try'] = 0; } if (isset($_GET['action']) and $_GET['action'] == "logout") {
<?php /** * 带混淆的验证码 * @date 2015.10.24 * @author pant0 **/ session_start(); $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['youpzt_captcha'] = $_vc->getCode(); //验证码保存到SESSION中 //验证码类 class ValidateCode { private $charset = 'abcdefghkmnprstuvwxyzABCDEFGHKMNPRSTUVWXYZ23456789'; //随机因子 private $code; //验证码 private $codelen = 4; //验证码长度 private $width = 90; //宽度 private $height = 43; //高度 private $img; //图形资源句柄 private $font; //指定的字体 private $fontsize = 20;
<?php require substr(dirname(__FILE__), 0, -7) . '/init.inc.php'; $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['code'] = $_vc->getCode();
public function index() { $validateCode = new ValidateCode(); $validateCode->outputCodeImg(); $_SESSION['code'] = $validateCode->getCode(); }