When introducing an external verification code class, you need to make modifications in the imported external verification code class file.
Modify as follows:
public function __construct($arr = array()) { $width = ''; $height = ''; $codeLen = ''; $fontSize = ''; $bgColor = ''; $fontColor = ''; if(!empty($arr)){ extract($arr); } $this->font = BASEPATH . "fonts/font.ttf"; if (!is_file($this->font)) { error("验证码字体文件不存在"); } $this->width = empty($width) ? $this->width : $width; $this->height = empty($height) ? $this->height : $height; $this->bgColor = empty($bgColor) ? $this->bgColor : $bgColor; $this->codeLen = empty($codeLen) ? $this->codeLen : $codeLen; $this->fontSize = empty($fontSize) ? $this->fontSize : $fontSize; $this->fontColor = empty($fontColor) ? $this->fontColor : $fontColor; $this->create();//生成验证码 }
The above is the content of the precautions for introducing external verification codes in the CI framework. For more related content, please pay attention to the PHP Chinese website (www.php.cn) !