Welcome Guest, Not a member yet? Register   Sign In
problem with sending mail
#7

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]';
        }


      }
        
    }
Reply


Messages In This Thread
problem with sending mail - by koficypher - 05-02-2016, 08:37 AM
RE: problem with sending mail - by InsiteFX - 05-02-2016, 11:21 AM
RE: problem with sending mail - by koficypher - 05-05-2016, 07:00 AM
RE: problem with sending mail - by PaulD - 05-05-2016, 07:37 AM
RE: problem with sending mail - by InsiteFX - 05-05-2016, 10:22 AM
RE: problem with sending mail - by koficypher - 05-05-2016, 12:33 PM
RE: problem with sending mail - by koficypher - 05-05-2016, 12:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB