0
の新機能Codeigniter。私は自分のプロジェクトにログイン&登録ページを作成したいと思います。ログインと登録は成功ですが、メールを確認したい場合は404が見つかりませんをクリックしてください。何がこのコードで間違っている。私はCodeigniter電子メールの確認
おかげ
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Voter_model extends CI_Model
{
function __construct()
{
// Call the Model constructor
parent::__construct();
}
//get the username & password from tbl_usrs
function get_user($username, $password)
{
$sql = "select * from user where username = '" . $username . "' and password = '" . $password . "' and status = '1'";
$query = $this->db->query($sql);
return $query->num_rows();
}
//insert into user table
function insertUser($data)
{
return $this->db->insert('user', $data);
}
//send verification email to user's email id
function sendEmail($to_email)
{
$from_email = ''; //change this to yours
$subject = 'Aktivasi Akun';
$message = 'Dear'. $username .'<br /><br />Please click on the below activation link to verify your email address.<br /><br />
'. site_url('voter/voter_register/verify') . md5($to_email) . '<br /><br /><br />Thanks<br />Admin, Gus bala';
//configure email settings
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com'; //smtp host name
$config['smtp_port'] = '465'; //smtp port number
$config['smtp_user'] = $from_email;
$config['smtp_pass'] = ''; //$from_email password
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n"; //use double quotes
$this->email->initialize($config);
//send mail
$this->email->from($from_email, 'Admin Evoting');
$this->email->to($to_email);
$this->email->subject($subject);
$this->email->message($message);
return $this->email->send();
}
//activate user account
function verifyEmailID($key)
{
$this->load->database();
$data = array('status' => 1);
$this->db->where(md5('email'), $key);
$this->db->update('user', $data);
}
}?>
にデータを渡すに達します。 –
エラー番号:1054 'WHERE句' UPDATE 'SET user'で 不明な列 '0c83f57c786a0b4a39efab23731c7ebc' status' = 1 '0c83f57c786a0b4a39efab23731c7ebc' = '6d6ed6fb6b990a099d67af6b1986916e' ファイル名:C:/ XAMPP/htdocsに/ evotingcucukan /アプリケーション/モデル/ Voter_model.php 行番号:61 –
今私はこのようなエラーに直面する。 –