Example #1
0
<?php

/**
 * 验证码
 * @author winsen
 * @version 1.0.0
 */
include 'library/init.inc.php';
$_vc = new Code();
//实例化一个对象
$_vc->doimg();
$_SESSION['code'] = $_vc->getCode();
//验证码保存到SESSION
Example #2
0
<?php

include 'library/init.inc.php';
$code = new Code(array('line' => false, 'snow' => false));
$code->doimg();
$_SESSION['code'] = $code->getCode();