Welcome Guest, Not a member yet? Register   Sign In
E-mail function not working correctly
#1

[eluser]joshsmith[/eluser]
Hey i am currently building a registration form. I am up to the e-mail part but its not working correctly as of now. I have added both of my function (both on controller 'User'). When i echo out the e-mail string i get a error on line 49. anyone know why this is not working?

Line 49
Code:
echo 'Click the link below to activate your account' . anchor('http://localhost/codetwo/index.php/user/random_string/' . $activation_code,'Confirmation Register';

Code:
function register(){
        
            $this->load->library('form_validation');
            
            $this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[12]|xss_clean|callback_dbcheck');
            $this->form_validation->set_rules('name', 'Name', 'required|min_length[3]|max_length[20]|xss_clean');
            $this->form_validation->set_rules('email', 'E-mail', 'required|min_length[3]|max_length[20]|xss_clean|valid_email');
            $this->form_validation->set_rules('password', 'Password', 'required|min_length[3]|max_length[20]|xss_clean');
            $this->form_validation->set_rules('password_conf', 'Re-type Password', 'required|min_length[3]|max_length[20]|xss_clean|matches[password]');
    
            if ($this->form_validation->run() == FALSE) {
            
                $this->load->view('viewregister');
            }
                else {
                $username = $this->input->post('username');
                $name = $this->input->post ('name');
                $email = $this->input->post ('email');
                $password = $this->input->post ('password');
                
                $activation_code = $this->random_string(10);
                
                $this->Usermodel->register_user($username,$name, $email, $password, $activation_code);
                
                // send e-mail verification
                
                $this->load-library('email');
                $this->email->from('[email protected]', 'al');
                $this->email->to();
                $this->email->subject('Registration Confirmation');
                $this->email->message('Click the link below to activate your account' . anchor('http://localhost/codetwo/index.php/user/confirmation_activation/' . $activation_code,'Confirmation Register'));
                
                echo 'Click the link below to activate your account' . anchor('http://localhost/codetwo/index.php/user/random_string/' . $activation_code,'Confirmation Register';
            //    echo " you have been registered $username";
                
            }
        }

Code:
function random_string() {
        $chars = "abcdefghijklmnopqrstuvwxyz0123456789";
        srand((double)microtime()*1000000);
        $i = 0;
        $pass = '';
        
        while ($i <= 7) {
            $num = rand() % 33;
            $tmp = substr($chars, $num, 1);
            $pass = $pass .$tmp;
            $i++;
        }
        
        return $activation_code;
    }


Messages In This Thread
E-mail function not working correctly - by El Forum - 08-13-2011, 04:44 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 05:03 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 05:21 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 05:35 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 05:52 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 06:09 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 06:38 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 08:05 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 08:22 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 09:14 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 10:07 PM
E-mail function not working correctly - by El Forum - 08-13-2011, 10:40 PM
E-mail function not working correctly - by El Forum - 08-14-2011, 10:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB