Create Session Using Ajax
We would discuss about to create seesion using codeigniter. Here we have to done on the function to do that codeigniter framework. The given fields like username, password, date of birth, email, phone number those are validation here.Then we have to move instalization to create file in controller folder. Then given below coding to copy and paste there. That function name is add_register. In that function we do the form validation and store form data to the particular variable. Then it should pass to the library function.
<?php
//controller
public function add_register()
{
//form validation
$this->form_validation->set_rules('user_name','Username','trim|required|xss_clean|is_unique[user.user_name]');
$this->form_validation->set_rules('dob','Date Of Birth','trim|required|xss_clean');
$this->form_validation->set_rules('user_email','Email','trim|required|valid_email|xss_clean|is_unique[user.user_email]');
$this->form_validation->set_rules('ph_no','Phone Number','trim|required|numeric|xss_clean');
$this->form_validation->set_rules('user_password','Password','trim|required|xss_clean');
if($this->input->is_ajax_request()) { $data['ajax']=TRUE; } else { $data['ajax']=FALSE; }
$data['response']='';
if($this->form_validation->run()===FALSE)
{