I have this controller function:
public function login()
{
.......
if ($this->form_validation->run() == FALSE)
{
$this->load->view('login');
}
else
{
if(isset($username) && isset($password))
{
if(isset($result) && $result->num_rows() > 0)
{
$result = $result->result_array();
$data['result'] = $result;
$this->session->set_userdata($data);
$this->load->view('profile', $data);
}else{
show_error('Authentication was not successful!');
}
}
}
}else{
$this->load->view('login');
}
}
Once successful, it goes to profile page and shows data. The only problem is that the URL showing before user enters credentials and once the profile.php is loaded is the same i.e. domain.com/profile/login. I want that after login successful, the username of the user logged in to show so : domain.com/profile/username. Is this possible? if not, at least can I remove the login segment from URL?