Codeigniter noob here:
I am wanting to let users click a button inside someone's profile in order to send them a message, I need to pass the variable from the view back to the controller and into another view, how can I accomplish this? The variable is $username in the first view:
View #1: (this works)
<a href="<?php echo base_url().'user/user_message';?>">
<button type="submit" class="btn btn-info btn-small" title="Send Message" >Send Message</button>
</a>
<h3><?php echo $username;?>- Public Profile</h3>
Controller:
public function user_message($username)
{
if($this->form_validation->run() == FALSE)
{
$this->load->view('header_loggedin');
$this->load->view('user/send_message', $username);
$this->load->view('footer');
}
else
I basically want to grab the $username variable from my first view and make it avaliable in the user/send_message view. Thanks for your help!