title: How to pass a jQuery variable to PHP code?
body: <p>I have reframed my Question:</p>
  
  <p>I have a drop down box which is populated with a list of users. </p>
  
  <pre><code>    &lt;a href="#" class="Share&lt;?=$r['Form']['id'];?&gt;"&gt;Share&lt;/a&gt;
      &lt;form action="/FormBuilder/index.php/forms/share/&lt;?=$r['Form']['id']?&gt;/&lt;?=$userid?&gt;" method="post" id="shareform&lt;?=$r['Form']['id'];?&gt;" class="shareform"&gt;
              &lt;p&gt;Select the users with whom you want to share the Form&lt;/p&gt;
              &lt;select id="userList" name="userList" multiple&gt;
                      &lt;?php foreach($users as $user){  ?&gt;
                              &lt;option value=&lt;?=$user['User']['id'];?&gt;&gt;&lt;?=$user['User']['name'];?&gt;&lt;/option&gt;        
                      &lt;?php }?&gt;
              &lt;/select&gt; 
              &lt;input type="submit" class="button" value="Share"/&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>When I select the user and give submit, the Form's access field in the database is updated to "Shared".</p>
  
  <p>Now I need to display the Form name that has been shared in the home page of the user whom I selected. This is the code for displaying the Form names that have been marked as "shared". </p>
  
  <pre><code>    &lt;?php if (!empty($formsShared)){   
      foreach ($formsShared as $shared): 
          echo $shared['Form']['name']; 
      endforeach; 
      }
      else{
          echo "There are no shared Forms !"; 
      }?&gt;
  </code></pre>
  
  <p>I need to get the selected values in the drop down box, so that I can have another for loop to display the Shared form only in the selected users home page. How do I get the option:value?</p>