Change the following line
<a href="<?php echo base_url().'user/user_message';?>">
For
<?php echo base_url().'user/user_message/'.$username;?>
So your public function user_message($username){ ... } will get the $username parameter as the parameter. Once you get it in the controller method, you can send it to the second view when you load the view with other data, e.g.
... $data['username'] = $username; $this->load->view('viewname', $data);
Then you can use $username in your view.
source share