Posts

Showing posts from July, 2014

Send email by using codeigniter library via localhost

function sendMail () { $config = Array ( 'protocol' => 'smtp' , 'smtp_host' => 'ssl://smtp.googlemail.com' , 'smtp_port' => 465 , 'smtp_user' => 'xxx@gmail.com' , // change it to yours 'smtp_pass' => 'xxx' , // change it to yours 'mailtype' => 'html' , 'charset' => 'iso-8859-1' ,

form validation rules in CodeIgniter

<? php class Form extends CI_Controller { public function index () { $this -> load -> helper ( array ( 'form' , 'url' )); $this -> load -> library ( 'form_validation' ); $this -> form_validation -> set_rules ( 'username' , 'Username' ,     'callback_username_check' ); $this -> form_validation -> set_rules ( 'password' , 'Password' ,     'required' ); $this -> form_validation -> set_rules ( 'passconf' ,     'Password Confirmation' , 'required' ); $this -> form_validation -> set_rules ( 'email' , 'Email' ,     'required|is_unique[users.email]' );