Skip to content

rejuan/Web-Service-Codeigniter-Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Web-Service-Codeigniter-Helper

Here I am adding an example how you can use this helper.

  1. First download this code from github. Then copy the webservice_helper.php and paste it to the "helpers" folder which is located in "application" folder.

  2. Open the autoload.php from the "config" folder and add "webservice" as helper

     $autoload['helper'] = array('url','file','webservice'); 
  3. Make a table called "user" which have 3 field 'id', 'email', 'password' and add some dummy data into the database

  4. Add the following code to the controller

    
    public function signin()
    {
    	$this->load->model('user_model');
    	
    	$email = $this->input->get_post('email');
    	$password = $this->input->get_post('password');
    	
    	if($this->user_model->signin($email, $password))
    		$msg = "successfully login";
    	else
    		$msg = "username and password doesn't match";
    	
    	
    	$output = array(
    						'msg' => $msg
    					);
    	
    	jsonOutput($output);
    }
    
  5. Make a model named "user_model" add the following code to the model

    
     function signin()
     {
     	$query = $this->db->get_where('user', array('email' => $email, 'password' => $password));
     	
     	if($query->num_rows() > 0)
     		return true;
     	else
     		return false;
     }
     

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages