Welcome Guest, Not a member yet? Register   Sign In
Call to undefined method
#6

[eluser]darshanchalla[/eluser]
i am sending u the two controller that i am using
Code:
(1)  controller::=site.php
<?php
class site extends ci_controller{
   function __construct()
    {  
      parent::__construct();
     $this->is_logged_in();
    }

function members_area()
{
  $this->load->view('members_area');}
}
function is_logged_in()
{
    $is_logged_in=$this->session->userdata('is_logged_in');
    if(!isset($is_logged_in)||$is_logged_in!=true)
    {
       echo 'You Dont have permission to access this page.<a href="../login">Login</a>';
    die();
    }
}
?&gt;


(2)controller::=login.php

&lt;?php
class Login extends Ci_controller{
function index()
     {
   $data['main_content']='login_form';
   $this->load->view('include/template',$data);
  }
       function validate_credentials(){
          $this->load->model('member_model');
          $query=$this->member_model->validate();
          if($query)
              {
             $data=array(
             'username'=>$this->input->post('username'),
             'is_logged_in'=>true);
             $this->session->set_userdata($data);
             redirect('site/members_area');
           }
      else
          {
          $this->index();
       }
                                   }
  function signup()
  {
   $data['main_content']='signup_form';
   $this->load->view('include/template',$data);
  }
  function create_member()
  {
   $this->load->library('form_validation');
   $this->form_validation->set_rules('first_name','First Name','trimrequired');
   $this->form_validation->set_rules('last_name','Last Name','trimrequired');
   $this->form_validation->set_rules('username','Username','trimrequired|min_length[4]');
   $this->form_validation->set_rules('password','Password','trimrequired|min_length[4]|max_length[32]');
   $this->form_validation->set_rules('password2','Password Confirmation','trimrequired|matches[password]');
   if($this->form_validation->run() ==FALSE)
   {
    $this->signup();
   }
   else
   {
     $this->load->model('member_model');
     if($query=$this->member_model->create_member()){
      $data['main_content']='signup_successful';
      $this->load->view('include/template',$data);
   }
   else
   {
     $this->load->view('signup_form');
   }
  
  }

}}
?&gt;


Messages In This Thread
Call to undefined method - by El Forum - 02-02-2013, 05:14 AM
Call to undefined method - by El Forum - 02-02-2013, 05:55 AM
Call to undefined method - by El Forum - 02-02-2013, 06:01 AM
Call to undefined method - by El Forum - 02-02-2013, 06:32 AM
Call to undefined method - by El Forum - 02-02-2013, 10:33 AM
Call to undefined method - by El Forum - 02-02-2013, 11:32 AM
Call to undefined method - by El Forum - 02-02-2013, 01:20 PM
Call to undefined method - by El Forum - 02-02-2013, 11:00 PM
Call to undefined method - by El Forum - 02-04-2013, 11:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB