|
发表于 2012-2-6 11:16:37
|
显示全部楼层
本帖最后由 wang1912 于 2012-2-6 11:25 编辑
//验证码加载
$this->load->helper('captcha');
$vals = array(
'img_path' => './yzm/',
'img_url' => 'http://localhost/yzm/',
'img_width' => 50,
'img_height' => 30,
'expiration' => 60*2,
'wordlen' =>4 //几位看着办就可以了
);
$cap = create_captcha($vals);
echo $cap;
captcha_helper.php 中修改如下:
$defaults = array('word' => '', 'img_path' => '', 'img_url' => '', 'img_width' => '150', 'img_height' => '30', 'font_path' => '', 'expiration' => 7200, 'wordlen' => 4 设置个默认位数);
找到此处修改一下
$pool = '023456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ';
$str = '';
for ($i = 0; $i < $wordlen; $i++)
{
$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
}
现在想要几位就要几位
|
评分
-
查看全部评分
|