【发布时间】:2014-05-23 10:38:23
【问题描述】:
我一直在调整我在教程和其他帖子中看到的独特电子邮件验证代码。但是,我的代码似乎没有什么能完美运行。
public function register_client($post_obj)
{
//client registration
$record = array
(
'first_name' => $post_obj['c_fname'],
'last_name' => $post_obj['c_lname'],
'email_address' => $post_obj['c_eadd'],
'password' => $post_obj['c_pword'],
'address' => $post_obj['c_add'],
'tagline' => $post_obj['c_tagline'],
'profile' => $post_obj['c_profile'],
'interests' => $post_obj['c_interest'],
'billing_mode' => $post_obj['c_bmode']
);
$this->db->insert('client', $record);
}
在我的控制器中我有这个:
public function client_signup_submit()
{
// completes client registration
/*$post_email = $this->input->post('c_eadd');
$this->form_validation->set_rules('c_eadd', 'Email Address', 'required|trim|xss_clean|valid_email|callback_check_duplicate_email[' . $post_email . ']');
$this->form_validation->set_message('check_duplicate_email', 'This email already exits. Please write a new email.');
if ($this->form_validation->run() == FALSE) {
// validation failed then do that
$this->load->view('client_signup');
} else */
//$this->form_validation->set_rules('c_eadd',Email,'trim|xss_clean|required|valid_email|callback_check_email_exists');
$this->inspire_model->register_client($_POST);
redirect("in/client?message=Client Account Registration Completed.");
}
我已经评论了几行,因为它们无论如何都不起作用。我检查了我的系统/库/form_validation,它似乎设置正确。
【问题讨论】:
标签: php forms codeigniter validation email