[英]captcha in php codeigniter showing fatal error
我对 codeigniter 完全陌生,我使用 codeigniter 中的登录表单的在线教程创建了验证码。 加载登录页面时出现以下错误:
> 致命错误:调用未定义的 function 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
Go 到application/config/autoload.php
在下面写下这一行(您会在第 90 行找到 codeigniter 不错的文档$autoload['helper'] = array('url');
这将自动加载 url 助手。 base_url() function is defined in url helper
您可以为特定的 controller 手动加载它
写这行$this->load->helper('url');
在 controller 构造函数内或
Controller action function
有关 base_url 的更多信息,请单击
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.