此生成验证码功能中的图像路径和图像 url 是什么?
what is the image path and image url in this generate captcha function?
我正在尝试查找下面控制器函数中给出的 img_path 和 img_url。那就是生成验证码。有人知道下面控制器函数中给出的 img_path 和 img_url 是什么吗?
控制器
function generateCaptcha() {
//Load Captcha helper
$this->load->helper('captcha');
$vals = array(
'word' => 'Security Key words',
'img_path' => './uploads/captcha/',
'img_url' => base_url() . 'captcha/',
'img_width' => 200,
'img_height' => 50,
'expiration' => 7200,
);
/* Generate the captcha */
$captcha = create_captcha($vals);
/* Store the captcha value (or 'word') in a session to retrieve later */
$this->session->set_userdata('captchaWord', $captcha['word']);
$this->session->set_userdata('captchaImage', $captcha['image']);
return $captcha['image'];
}
这里
img_path 是你的 captach 文件夹的绝对路径
img_url是验证码图片的相对路径
$vals = array(
'word' => 'Security Key words',
'img_path' => './uploads/captcha/',
'img_url' => base_url() . 'uploads/captcha/',
'img_width' => 200,
'img_height' => 50,
'expiration' => 7200,
);
我正在尝试查找下面控制器函数中给出的 img_path 和 img_url。那就是生成验证码。有人知道下面控制器函数中给出的 img_path 和 img_url 是什么吗?
控制器
function generateCaptcha() {
//Load Captcha helper
$this->load->helper('captcha');
$vals = array(
'word' => 'Security Key words',
'img_path' => './uploads/captcha/',
'img_url' => base_url() . 'captcha/',
'img_width' => 200,
'img_height' => 50,
'expiration' => 7200,
);
/* Generate the captcha */
$captcha = create_captcha($vals);
/* Store the captcha value (or 'word') in a session to retrieve later */
$this->session->set_userdata('captchaWord', $captcha['word']);
$this->session->set_userdata('captchaImage', $captcha['image']);
return $captcha['image'];
}
这里
img_path 是你的 captach 文件夹的绝对路径
img_url是验证码图片的相对路径
$vals = array(
'word' => 'Security Key words',
'img_path' => './uploads/captcha/',
'img_url' => base_url() . 'uploads/captcha/',
'img_width' => 200,
'img_height' => 50,
'expiration' => 7200,
);