php codeigniter 中的验证码显示致命错误
captcha in php codeigniter showing fatal error
我是 codeigniter 的新手,我使用在线教程在 codeigniter 中为我的登录表单创建了一个验证码。加载登录页面时出现以下错误:
> 致命错误:调用未定义的函数 base_url() in
$config = array(
'img_path' => 'captcha_images/',
'img_url' => base_url().'captcha_images/',
'img_width' => '150',
'img_height' => 50,
'word_length' => 8,
'font_size' => 16
);
$captcha = create_captcha($config);
i dont have any folder named 'captcha_images', all i have is a controller for captcha,config and the view in login. As am new to this, is it because i dont have a folder or i didnt call any library? please help me with this. thanks in advance
前往
application/config/autoload.php
将这一行写在下面(您会在第 90 行找到 codeigniter 不错的文档)
$autoload['helper'] = array('url');
这将自动加载 url 助手。
base_url() function is defined in url helper
您可以为特定控制器手动加载它
写这一行 $this->load->helper('url');
在控制器构造函数中或
Controller action function
有关 base_url click
的更多信息
我是 codeigniter 的新手,我使用在线教程在 codeigniter 中为我的登录表单创建了一个验证码。加载登录页面时出现以下错误:
> 致命错误:调用未定义的函数 base_url() in
$config = array(
'img_path' => 'captcha_images/',
'img_url' => base_url().'captcha_images/',
'img_width' => '150',
'img_height' => 50,
'word_length' => 8,
'font_size' => 16
);
$captcha = create_captcha($config);
i dont have any folder named 'captcha_images', all i have is a controller for captcha,config and the view in login. As am new to this, is it because i dont have a folder or i didnt call any library? please help me with this. thanks in advance
前往
application/config/autoload.php
将这一行写在下面(您会在第 90 行找到 codeigniter 不错的文档)
$autoload['helper'] = array('url');
这将自动加载 url 助手。
base_url() function is defined in url helper
您可以为特定控制器手动加载它
写这一行 $this->load->helper('url');
在控制器构造函数中或
Controller action function
有关 base_url click
的更多信息