title: how to display home page after successfull login with codeigniter?
body: <p>I tried <code>redirect()</code> and <code>$this-&gt;load-&gt;view('target_page')</code> but, no success for me so please help me with this:</p>
  
  <p><strong>My controller is here:</strong></p>
  
  <pre><code>class Login_control extends CI_Controller {    
  public function index() {
  $this-&gt;load-&gt;model('login_model'); 
  $this-&gt;load-&gt;helper('url');
  if(isset($_POST['Logusername'])|| isset($_POST['Logpassword']))
  {
  $user = $_POST['Logusername'];
  $pass = $_POST['Logpassword'];
  $data = $this-&gt;login_model-&gt;login1($user,$pass);
  if($data &gt; 0 )
  {
   echo '&lt;font color="#00FF00"&gt;'. "OK".'&lt;/font&gt;';     
  $this-&gt;load-&gt;view('testing',$data);                   
   }
  else 
  { echo  '&lt;font color="#FF0000"&gt;'. "Login Failed ! Username or Password is Incorrect.".'&lt;/font&gt;' ;                     
  }  
  exit();            
  }  
  $this-&gt;load-&gt;view('signup_view');
  }
  }
  </code></pre>