我有一个codeigniter网站,我使用验证码,我的验证码在最后一台服务器上工作,但在新服务器中没有创建,也没有使用验证码 我使用Windows Server 2016标准,IIS 10< PHP 7.0和Codeigniter 3.1
function index()
{
if ($this->session->userdata('us_login') == TRUE)
{
redirect ('dashboard');
}
else
{
$data['captcha'] = $this->_create_captcha();
$this->load->view('login', $data);
}
}
function _create_captcha()
{
$this->load->helper('captcha');
// numeric random number for captcha
$random_number = substr(number_format(time() * rand(),0,'',''),0,8);
// setting up captcha config
$vals = array(
'word' => $random_number,
'img_path' => './captcha/',
'img_url' => base_url().'captcha/',
'img_width' => 280,
'img_height' => 45,
'expiration' => 7200
);
$data['captcha'] = create_captcha($vals);
$this->session->set_userdata('captchaWord',$data['captcha']['word']);
return $data['captcha'];
}
答案 0 :(得分:0)
对你的问题不一样了。
在Codeigniter路径system/helpers/captcha_helper.php
你最常修改captcha_helper
- if (($rand_index = unpack('C', $bytes[$byte_index++])) > $rand_max)
+ list(, $rand_index) = unpack('C', $bytes[$byte_index++]);
+ if ($rand_index > $rand_max)