Error with email varification(helper/controller) |
Hello!
When I press activtate to login after register I get an error 404 code. I seems as if the code created withn DB is not linking well. I have a helper and controller but cant seem to figure out which is causing it: Code(helper): Account verification email sender function */ if(! function_exists('emailVerification')){ function emailVerification($userID){ $ci =& get_instance(); $ci->load->library('email'); $ci->load->model('user'); $con['returnType'] = 'single'; $con['conditions'] = array( 'id' => $userID ); $user = $ci->user->getRows($con); $emailVerifyLink = base_url().'verifyEmail/'.$user['activation_code']; $config['mailtype'] = 'html'; $ci->email->initialize($config); $ci->email->to($user['email']); $ci->email->from(' [email protected]', 'Cultured Kink'); $ci->email->subject('Please Confirm Your Email | Cultured Kink'); $ci->email->message($mailContent); $ci->email->send(); return true; } } Code(controller): * User email verification */ public function verifyEmail($activation_code){ //redirect logged in user to dashboard if($this->userId){ redirect('dashboard'); } $data = array(); //if the activation code is available if(!empty($activation_code)){ //check whether the activation code exists in the database $con['conditions'] = array( 'activation_code' => $activation_code ); $con['returnType'] = 'single'; $checkUser = $this->user->getRows($con); //if activation code is matched if(!empty($checkUser)){ //activate user for login $actData = array('activated' => '1'); $update = $this->user->update($actData, array('activation_code' => $activation_code)); //send user registration email @userRegistrationEmail($checkUser['id'], '*****'); //store status message $this->session->set_userdata('success_msg', 'Email verification for your account was successful. Please login to your account.'); //redirect to login page redirect('login'); }else{ $this->session->set_userdata('error_msg', 'You have clicked on the wrong verification link, please check your email and try again.'); redirect('login'); } }else{ //redirect to login page redirect('login'); } } I apologize if this question is redundant..just need help trying to connect the two so that when a new member gets email they can log in with ease. , Mekaboo |
Messages In This Thread |
Error with email varification(helper/controller) - by Mekaboo - 07-20-2019, 09:28 AM
RE: Error with email varification(helper/controller) - by php_rocs - 07-21-2019, 06:13 AM
RE: Error with email varification(helper/controller) - by Mekaboo - 07-22-2019, 07:59 PM
RE: Error with email varification(helper/controller) - by InsiteFX - 09-09-2019, 08:04 AM
|