用户
 找回密码
 入住 CI 中国社区
搜索
查看: 2101|回复: 3
收起左侧

新手提问验证码路径问题

[复制链接]
发表于 2012-6-6 17:33:55 | 显示全部楼层 |阅读模式
下面是手册中的代码:

PHP复制代码
 
$vals = array(
    'word' => 'Random word',
    'img_path' => './captcha/',
 
    'img_url' => 'http://example.com/captcha/',
    /*上面 这一行用什么能代替 ‘'http://example.com’这个呢,必须写死吗?*/
 
    'font_path' => './path/to/fonts/texb.ttf',
    'img_width' => '150',
    'img_height' => 30,
    'expiration' => 7200
    );
 
复制代码


另外:
“./”是代表网站的跟目录吗?
发表于 2012-6-7 13:00:37 | 显示全部楼层
'http://example.com/captcha/'这个代表你存放验证码的图片路径,用你的网站地址替代http://example.com
发表于 2012-6-7 14:35:57 | 显示全部楼层
使用$this->config->item('base_url')   是你站的地址
./是上一层目录的意思(相对当前URL)
 楼主| 发表于 2012-6-7 17:25:17 | 显示全部楼层
非常感谢,用URL辅助函数最好

本版积分规则