zhjphp 发表于 2012-6-6 17:33:55

新手提问验证码路径问题

下面是手册中的代码:


$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

Ding 发表于 2012-6-7 14:35:57

使用$this->config->item('base_url')   是你站的地址
./是上一层目录的意思(相对当前URL)

zhjphp 发表于 2012-6-7 17:25:17

非常感谢,用URL辅助函数最好
页: [1]
查看完整版本: 新手提问验证码路径问题