Welcome Guest, Not a member yet? Register   Sign In
redirect not working
#8

(12-08-2014, 01:09 PM)hadeel Wrote: I tried that also still not working Sad

Replace this in your controller

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Home extends CI_Controller {


    public function 
__construct()
    {
        
// Call the Model constructor
        
parent::__construct();
        
$this->load->model('admin/adminloginmodel');

        
// Load your helpers / drivers / libraries globaly from the autoload.php file. You will need them across you app, not just here.
        
$this->load->library('session');
        
$this->load->helper('url');
    }

    public function 
index()
    {
        
//$objResponse=new xajaxResponse();
        
$data['msg']= '';

        if(isset(
$_POST['submit']))
        {
            
$msg=$this->adminloginmodel->check_adminlogin();
            
//echo $msg;
            
if($msg != 'success')
            {
                
$data['msg']= $msg;
                
redirect('admin/dashboard''refresh');

            } else {
                
redirect('admin/dashboard');
            }
        }
        
$this->load->view('admin/adminhome_view',$data);
    }


}
/* End of file home.php */
/* Location: ./application/controllers/home.php */ 


And this in your .htaccess file


Code:
<IfModule mod_rewrite.c>

 Options +FollowSymLinks
 RewriteEngine on

 # Send request via index.php
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteCond $1 ^(robots\.txt|favicon\.ico|style\.css)

   # deal with php5-cgi first
   <IfModule mod_fcgid.c>
       RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
   </IfModule>

   <IfModule !mod_fcgid.c>
       # for normal Apache installations
       <IfModule mod_php5.c>
           RewriteRule ^(.*)$ index.php/$1 [QSA,L]
       </IfModule>

       # for Apache FCGI installations
       <IfModule !mod_php5.c>
           RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
       </IfModule>
   </IfModule>

</IfModule>
Romanian CodeIgniter Team :: Translations :: Comunity :: Developers
http://www.codeigniter.com.ro
Reply


Messages In This Thread
redirect not working - by hadeel - 12-08-2014, 02:19 AM
RE: redirect not working - by sv3tli0 - 12-08-2014, 02:42 AM
RE: redirect not working - by hadeel - 12-08-2014, 02:44 AM
RE: redirect not working - by InsiteFX - 12-08-2014, 04:44 AM
RE: redirect not working - by hadeel - 12-08-2014, 04:57 AM
RE: redirect not working - by Avenirer - 12-08-2014, 08:11 AM
RE: redirect not working - by hadeel - 12-08-2014, 01:09 PM
RE: redirect not working - by Dracula - 12-09-2014, 05:55 AM
RE: redirect not working - by satti - 07-07-2019, 11:16 AM
RE: redirect not working - by Andryshok - 07-07-2019, 11:46 AM
RE: redirect not working - by hadeel - 12-10-2014, 03:19 AM
RE: redirect not working - by Rufnex - 12-11-2014, 02:42 PM
RE: redirect not working - by satti - 07-07-2019, 12:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB