|
发表于 2011-5-29 08:43:59
|
显示全部楼层
PHP复制代码
public function captcha ($refresh='0') { $session_word = $this->session->userdata('captcha_word'); if (empty($session_word) || !empty($refresh)){ $vals = array( 'img_path' => './images/captcha/', 'img_url' => base_url ().'images/captcha/', 'font_path' => './system/fonts/captcha.ttf', 'img_width' => '100', 'img_height' => '30', 'expiration' => '7200' ); $cap = create_captcha ($vals); $data = array( 'captcha_image' => $cap['image'], 'captcha_word' => $cap['word'] ); $this->session->set_userdata($data); return $cap['image']; }else{ return $this->session->userdata('captcha_image'); } }
复制代码
|
|