CodeIgniter에서 응용 프로그램을 작성하고 있습니다. CodeIgniter에서 db와 전자 메일을 비교하는 방법을 알고 있습니다. 제발 도와주세요.CodeIgniter를 사용하여 db에 이미 존재하는 전자 메일을 확인하는 방법
컨트롤러 이메일 alreay 존재 여부 wheather를 이메일로하는 방법
public function signup()
{
$this->load->view('signup');
}
public function savedata(){
$this->load->library('form_validation');
$this->form_validation->set_rules('firstname', 'firstname', 'required');
$this->form_validation->set_rules('lastname', 'lastname', 'required');
if ($this->form_validation->run() == TRUE) // Only add new option if it is unique
{
$result = $this->account_model->insert();
if($result > 0)
{
$data['message'] = "Added successfully";
$this->load->view('signup',$data);
}
else
{
$this->index();
}
}
else
{
$this->load->view('signup');
}
}
.
당신이 통과 않는 이메일에 고유 인덱스를 양식 유효성 검사
주 이 줄을 추가하고 필요로해야? –
'is_unique' 검증 규칙을 확인하십시오 –
답장을 보내 주셔서 대단히 감사합니다. 나는 대답을 얻었다. – Vijaykarthik