2017-01-12 8 views
0

登録済みのアカウントを有効にするために電子メールで確認リンクを送信しようとしています。メールを受信できましたが、受信したリンクをクリックするとエラーになります見つけた。私はメールcodeigniterで電子メールの検証が機能しないエラーが見つかりません

で受信したリンクをクリックしたときに電子メールを送信するための

コードは私のコントローラ email_verifyコードの

public function send_email($title,$fname,$lname,$email,$code) { $from_email = "[email protected]"; $to_email = $this->input->post('email'); $this->load->library('email'); $this->email->set_mailtype("html"); $this->email->from($from_email, 'Industry Speak'); $this->email->to($email); $this->email->subject('Registration Confirmation Mail from Industry Speak'); $message = '</<!DOCTYPE html> <html> <head> <title></title> </head> <body> <p>Welcome to Industry Speak <b>'.$title.' '.$fname.' '.$lname.'</b>, </p> <br> <p>Thanks for the signing up!</p> <P>Your account has been created, you can login with your provided credentials after you have activated your account by pressing the url below. </p> <p>Please click this link to activate your account: </p> <a href='.base_url().'Home/email_verify/'.$code.'/'.$email.'>Click Here to Activate Your Account</a> </body> </html>'; $this->email->message($message); if($this->email->send()) { $this->session->set_flashdata("msg", "<div class='alert alert-error' style='background: rgba(22, 111, 24, 0.84); color: #fff;'> <button class='close' data-dismiss='alert'>&times;</button> <strong>Sucess..!</strong> We sent a activation link to " .$email. " Please Activate your account. </div>"); redirect('Home/clients'); } } 


以下のコードは、

function email_verify($code,$email) 
    { 
     $condition=array("token_code"=>md5($code),"email_id"=>$email,"client_status"=>0); 
        $email_verification=$this->data['email_veri']=$this->Frontend_model->verify_email($condition); 

     if ($email_verification>0) 
     { 
      $this->session->set_flashdata("msg", "<div class='alert alert-error' style='background: rgba(22, 111, 24, 0.84); color: #fff;'> 
       <button class='close' data-dismiss='alert'>&times;</button> 
       <strong>Sucess..!</strong>Your account registered with " .$email. " is succesfully activated. Please login to your account. 
      </div>"); 
      redirect('Home/clients'); 
     } 
     else 
     { 
      $this->session->set_flashdata("msg", "<div class='alert alert-error' style='background: rgba(255, 87, 34, 0.96); color: #fff;'> 
       <button class='close' data-dismiss='alert'>&times;</button> 
       <strong>Error..!</strong> Getting error in activating your account linked with " .$email. " Please try again. 
      </div>"); 
      redirect('Home/clients'); 
     }  

    } 

エラーを下回っていますさ

enter image description here

このエラーを解決するにはどうすればよいですか?前もって感謝します。

+0

わかりましたが、あなたのURLが間違っている必要があります。*画像には、/Industry/Speak/10/1-2017/Home/email_verify/abcdewhatever/[email protected]がリクエストされています。あなたのサイトにアクセスするためにあなたが使用したURLとこれを比較しましたか? –

答えて

0

あなたのURIをverify/(:any)と定義しましたが、email_verify/にアクセスしようとしています。

Look at the docs:ルートで

$route['product/:num'] = 'catalog/product_lookup'; 

アレイ値はそれが再ルーティングされるべき宛先を含むが、配列のキーは、一致するURIを含みます。上記の の例では、リテラル単語 "product"がURLの最初の セグメントにあり、2番目のセグメントに番号が見つかった場合は、 "catalog"クラスと "product_lookup"メソッドが代わりに使用されます。

関連する問題