title: Passing a variable to a fancybox div
body: <p>I have a ul and a bunch of links surrounding the lis, which pulls data from an array and outputs different values. I'd like for when you click these links, it passes one of the values into the fancybox, as right now it's just slapping in the first option out of the array every time, no matter which link I click.</p>
  
  <pre><code>&lt;ul&gt;
  &lt;?php
  while(list($key, $val) = each ($arrayresult))
          {                               
              echo '&lt;a href="#inline" class="fancybox"&gt;&lt;li style="padding: 2px; margin: 0px; list-style: none;"&gt;';
              echo '&lt;img src="../images/profilepics/'.$charpic.'" style="float: right; padding-left: 10px; width: 40px;" /&gt;';
              echo '&lt;h2&gt;'.$val.' Position&lt;/h2&gt;';
              echo '&lt;p&gt;Click here to apply for this position.&lt;/p&gt;';
              echo '&lt;/li&gt;&lt;/a&gt;';
  
              echo '&lt;div id="inline" style="display:none;"&gt;';
              echo '&lt;h1&gt;Request Character Transfer&lt;/h1&gt;';
              echo '&lt;hr&gt;';
              echo '&lt;form id="transfer" action="TransferRequest" method="post"&gt;';
              echo '&lt;label for="transfer_character"&gt;Character to Transfer&lt;/label&gt;';
              echo '&lt;select id="transfer_character" name="transfer_character"&gt;';
              echo '&lt;option value=""&gt;Select Character&lt;/option&gt;';
  
              $request_character_query = "SELECT * FROM character_database WHERE character_active ='1' AND user_id = $user_id ORDER BY character_firstname DESC";
              $request_character_result = mysqli_query($mysqli, $request_character_query);
  
                  /*** loop over the results ***/
                  foreach($request_character_result as $charrow)
                  {
                      /*** create the options ***/
                      echo '&lt;option value="'.$charrow['character_id'].'"';
                      if($charrow['character_firstname']==42)
                      {
                          echo ' selected';
                      }
                      echo '&gt;'. $charrow['character_firstname'] . " " . $charrow['character_surname'] . '&lt;/option&gt;'."\n";
                  }
              echo '&lt;/select&gt;';
              echo '&lt;p&gt;Applying for the '.$val.' position on the '.$shipname.'&lt;/p&gt;';
              echo '&lt;p&gt;If this is correct, please submit below&lt;/p&gt;';
              echo '&lt;input type="hidden" value="'.$val.'" name="transfer_position"&gt;';
              echo '&lt;input type="hidden" value="'.$ship_id.'" name="transfer_ship"&gt;';
              echo '&lt;input type="hidden" value="'.$user_id.'" name="transfer_player"&gt;';
              echo '&lt;input value="Submit Request" type="submit" class="styled"&gt;';
              echo '&lt;/form&gt;';
              echo '&lt;/div&gt;';
          }
      ?&gt;
      &lt;/ul&gt;
  </code></pre>
  
  <p>I've got all of my code in the UL hoping that that would work, but apparently not. I also tried passing the variable in the URL, but then the fancybox doesn't open. This is the fancybox code;</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      $(".fancybox").fancybox();
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Nice and simple.</p>