title: Using jquery to process actions which require passing PHP variables within MVC framework
body: <p>I am using codeigniter. What i want to achieve is as follows.</p>
  
  <p>I am on a page /profile/username (Controller profile, function username).
  This function loads a view which has a submit button.</p>
  
  <pre><code>&lt;input type=submit value=apple&gt;
  </code></pre>
  
  <p>I then have a jquery file which has ajax processing such that when the submit button is clicked /profile/process_click (a private function) is called with $.post.</p>
  
  <p>The function process_click in the controller profile calls a method function which inserts the value of the submit button into the database (in this case 'apple'). Alongside this function needs to insert the username of the person on whos profile the link was clicked (in this case 'username').</p>
  
  <p>So.. my question is, how do I pass username from my profile controller to my jquery file such that it can be passed to process_click by $.post?</p>
  
  <p>I need a secure and safe and ideally not resource intensive way to do this..</p>
  
  <p>Cheers</p>