|
先上代码:
PHP复制代码 function index (){ $i = rand(1000,9999);
$vals = array(
'img_path' => './uploads/captcha/',
'img_url' => '/uploads/captcha/',
'word' => $i,
'img_width' => '70',
'img_height' => '21',
'expiration' => '720',
);
$cap = create_captcha ($vals);
$data = array(
'captcha_time' => time(),
'ip_address' => $this->input->ip_address(),
'word' => $cap['word'],
);
$query = $this->db->insert_string('captcha', $data);
$this->db->query($query);
echo $cap['image'];
} 复制代码
再来看效果:
四位的验证码,跑外面去了。。。囧
请各位指教
|
|