我的 CodeIgniter 验证码没有生成,所以我无法在我的视图中显示它
控制器
public function login() {
$this->load->helper('captcha');
$this->form_validation->set_rules($this->login_rules);
$userCaptcha = set_value('captcha');
$word = $this->session->userdata('captchaWord');
if($this->form_validation->run() == TRUE && strcmp(strtoupper($userCaptcha),strtoupper($word)) == 0) {
$this->session->unset_userdata('captchaWord');
$username = $this->input->post('username');
$password = $this->input->post('password');
if(!$this->autentifikasi->login($username,$password)) {
$this->session->set_flashdata('pesan', '<div class="error">Login gagal</div>');
redirect(site_url('user/login'));
} else {
$this->session->set_flashdata('pesan', '<div class="sukses">Anda telah berhasil login, selamat berbelanja.</div>');
redirect(site_url('user/login'));
}
}
$original_string = array_merge(range(0,9), range('a','z'), range('A', 'Z'));
$original_string = implode("", $original_string);
$captcha = substr(str_shuffle($original_string), 0, 6);
$vals = array(
'word' => $captcha,
'img_path' => './captcha/',
'img_url' => base_url().'user/login/',
'font_path' …Run Code Online (Sandbox Code Playgroud) 我有一些问题,我不明白.这是我的代码
$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);
$this->email->from('rudzstyle@yahoo.co.id', 'Your Name');
$this->email->to('rudzstyle@gmail.com');
$message = $data->nama_depan.'<br>'.$this->input->post('snk');
$this->email->subject($message);
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
Run Code Online (Sandbox Code Playgroud)
那2封电子邮件是有效电子邮件
调试器的结果就是这个
退出状态码:1无法打开Sendmail的套接字.请检查设置.无法使用PHP Sendmail发送电子邮件.您的服务器可能未配置为使用此方法发送邮件.
User-Agent:CodeIgniter日期:星期一,2014年6月2日07:53:21 +0200来自:"你的名字"返回路径:收件人:rudzstyle@gmail.com主题:=?iso-8859-1?Q?Riyanto test ?= =?iso-8859-1?Q ?? =回复:"rudzstyle@yahoo.co.id"X-Sender:rudzstyle@yahoo.co.id X-Mailer:CodeIgniter X-Priority:3(正常)消息ID:<538c1151179cb@yahoo.co.id> Mime版本:1.0
内容类型:text/plain; charset = iso-8859-1 Content-Transfer-Encoding:8bit
测试电子邮件类.