send a php variable in jquery dialog()
<p>I have a table with images and info about each image. Next to each image I have an 'add' button that when clicked opens a jquery dialog() with id="alignment".
I want to send a php variable (with the image name) so when you click on the 'add' button I can call the variable and the image name can be displayed in the dialog box. 
My code is: </p>

<pre><code>  foreach($uploaded as $upload){
$wgOut-&gt;addHTML('&lt;tr&gt;&lt;td&gt;&lt;button class="imageSetting"&gt;Add&lt;/button&gt;&lt;/td&gt;&lt;td&gt;');  
$wgOut-&gt;addHTML($upload[0]);
$wgOut-&gt;addHtml('&lt;/td&gt;&lt;td&gt;'); 
$wgOut-&gt;addHtml('&lt;img src="images/thumb/'.$upload[0].'/120px-'.$upload[0].'" /&gt;'); 
$wgOut-&gt;addHtml('&lt;/td&gt;&lt;td&gt;'); 
$wgOut-&gt;addHTML($upload[1]); 
$wgOut-&gt;addHTML('x'); 
$wgOut-&gt;addHTML($upload[2]); 
$wgOut-&gt;addHtml('&lt;/td&gt;&lt;td&gt;');
$wgOut-&gt;addHTML($upload[3]); 
$wgOut-&gt;addHtml('&lt;/td&gt;&lt;td&gt;');
$wgOut-&gt;addHtml($upload[4]);
$wgOut-&gt;addHtml('&lt;/td&gt;&lt;/tr&gt;'); 
  }
$wgOut-&gt;addScript('&lt;script type="text/javascript"&gt; 

    ( function($) {
        $(document).ready(function() {
        $(function() {          
        $( "#alignment" )
            .dialog({
                autoOpen: false,
                title: "Align Image",
                //draggable: false,
                resizable: false,
                buttons: {"Okay": function()      {$(this).dialog("close");}},

        });

        $(".imageSetting")
            .click(function() {
            $( "#alignment" ).dialog("open");
        });
        });     
        }); 
    } ) ( jQuery );

&lt;/script&gt;'); 

$wgOut-&gt;addHTML('&lt;div id="alignment"&gt;'); 
  $out = self::alignment();   
  $wgOut-&gt;addHtml($out);
$wgOut-&gt;addHTML('&lt;/div&gt;');
</code></pre>
