problem with sending mail |
-
koficypher Junior Member
 
-
Posts: 41
Threads: 10
Joined: Apr 2016
Reputation:
1
controller code;
Code: <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('model_user');
}
public function register_user()
{
$this->load->library('form_validation');
//$this->form_validation->set_error_delimiters('<div class="alert alert-danger" role="alert"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span><span class="sr-only">Error:</span>', '</div>');
$data['title'] = 'Register';
$this->form_validation->set_rules('firstname', 'First Name', 'trim|required|min_length[3]|max_length[15]');
$this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|min_length[3]|max_length[15]');
$this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[6]|max_length[15]|is_unique[user.username]');
$this->form_validation->set_rules('email', 'Email', 'trim|required|min_length[6]|max_length[30]|valid_email|is_unique[user.email]');
$this->form_validation->set_rules('password', 'Password', 'required|min_length[6]|max_length[20]|matches[password_conf]');
$this->form_validation->set_rules('password_conf', 'Confirm Password', 'required|min_length[6]|max_length[20]');
if ( $this->form_validation->run() === FALSE) {
$this->load->view('templates/header', $data);
// $this->load->view('templates/navigation');
$this->load->view('frontend/view_register');
$this->load->view('templates/footer');
}
else
{
$this->model_user->insert_user();
//echo 'good';
$this->load->view('templates/header');
$this->load->view('templates/navigation');
$this->load->view('frontend/view_register_success');
}
}
public function validate_email($email, $email_code)
{
$email_code = trim($email_code);
$validated = $this->model_user->validate_email($email, $email_code);
if(validated === TRUE) {
$this->load->view('templates/header');
$this->load->view('templates/navigation');
$this->load->view('frontend/view_email_validated');
} else {
echo 'Error giving email activated confirmation, please contact [email protected]';
}
}
}
|
Messages In This Thread |
RE: problem with sending mail - by koficypher - 05-05-2016, 12:38 PM
|