为什么 codeigniter 验证码在 Internet Explorer 中没有改变?
why codeigniter captcha doesn't change in internet explorer?
我用 codeigniter 3 创建了一个登录页面。
我的验证码在 Firefox 和其他现代浏览器中运行完美。但在 Internet Explorer 中,如果您刷新页面,它不会改变。我的代码有什么问题?
这里是link页面:http://www.artavil.ir/myadmin/
我的验证码:
function create(){
$rand = rand(1000,9999);
$config_captcha = array(
'word' => $rand,
'img_path'=> './captcha_pic/',
'img_url'=> 'http://artavil.ir/myadmin/captcha_pic/',
'img_width' =>'150',
'img_height' =>'30',
'expiration' => 7200
);
$captcha = create_captcha($config_captcha);
echo $captcha['image'];
}
很可能它正在被缓存。在您的 JS 中尝试此操作以防止缓存:
$("#captcha").load("http://www.artavil.ir/myadmin/captcha/create?" + Date.now());
我用 codeigniter 3 创建了一个登录页面。 我的验证码在 Firefox 和其他现代浏览器中运行完美。但在 Internet Explorer 中,如果您刷新页面,它不会改变。我的代码有什么问题?
这里是link页面:http://www.artavil.ir/myadmin/
我的验证码:
function create(){
$rand = rand(1000,9999);
$config_captcha = array(
'word' => $rand,
'img_path'=> './captcha_pic/',
'img_url'=> 'http://artavil.ir/myadmin/captcha_pic/',
'img_width' =>'150',
'img_height' =>'30',
'expiration' => 7200
);
$captcha = create_captcha($config_captcha);
echo $captcha['image'];
}
很可能它正在被缓存。在您的 JS 中尝试此操作以防止缓存:
$("#captcha").load("http://www.artavil.ir/myadmin/captcha/create?" + Date.now());