Welcome Guest, Not a member yet? Register   Sign In
redirect duplicating base url
#1

redirect('/register/f2') 

In my browser I get ci.local:8888/register/f1/ci.local:8888/register/f2

What am I doing wrong?

PHP Code:
class Register extends CI_Controller {

    function 
__construct() {
        
parent::__construct();
        
$this->load->library('form_validation');
 
     $this->form_validation->set_error_delimiters('<div class="text-danger">''</div>');
 
     $this->load->library('session');
 
     $this->load->helper('url');
    }

    function 
index() {
        
$this->_init_session();
        
$data = [
            
'title' => 'NCRS - Register',
            
'active' => 'register',
        ];
        
$this->load->view('header'$data);
        
$this->load->view('register');
        
$this->load->view('footer');
    }

    
//Route: /register/f1
    
function f1() {
        
$this->session->set_userdata($_REQUEST);
        
$this->form_validation->set_rules('name''Name''required|min_length[1]|max_length[125]');
        
$this->form_validation->set_rules('phone''Phone''required|min_length[12]|max_length[18]');
        if (
$this->form_validation->run() == FALSE) {
            
$data = [
                
'title' => 'NCRS - Contact Info',
                
'active' => 'register',
            ];
            
$this->load->view('header'$data);
            
$this->load->view('f1');
            
$this->load->view('footer');
        }
        else
            
redirect('/register/f2');

    }
... 
Reply
#2

Inn my config file the base URL was ci.local:8888/

It should be http://ci.local:8888/

Duh.
Reply
#3

Have you try redirect('register/f2')
Keep calm.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB