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中 }
public function actionGet() { $v = new ValidateCode(); $v->doimg(); }
<?php require substr(dirname(__FILE__), 0, -7) . '/init.inc.php'; $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['code'] = $_vc->getCode();
<?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(); }
public function codeAction() { $this->view->disable(); $vcode = new ValidateCode(); $vcode->doimg(); $this->session->set('code', $vcode->getCode()); }
<?php require '../engine/validatecode.php'; $vc = new ValidateCode('C:/windows/fonts/ARIALUNI.TTF'); $vc->doimg();
/** * 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中 }
public function validateCode() { $_vc = new ValidateCode(); $_vc->doimg(); $_SESSION['code'] = $_vc->getCode(); }
$gray = imagecolorallocate($im, 118, 151, 199); $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 onget_code() { require TIPASK_ROOT . '/lib/validatecode/validatecode.class.php'; //先把类包含进来,实际路径根据实际情况进行修改。 $_vc = new ValidateCode(); //实例化一个对象 $_vc->doimg(); $_SESSION['code'] = $_vc->getCode(); //验证码保存到SESSION中 }
<?php $codeString = $_GET["originalstring"]; //echo $codeString; //先把类包含进来,实际路径根据实际情况进行修改。 require 'ValidateCode.class.php'; //实例化一个对象 $_vc = new ValidateCode(); $_vc->doimg($codeString); ?> <!-- http://webtouch.com/testApp/php/verifyCode/createverifyImg.php?originalstring=1234 -->
<?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();