Open a php link in a javascript popup window
<p>I have a PHP script with an link like this <code>&lt;a href='iteminfo.php?ID={$i['itmid']}]}</code></p>

<p>I want to open this link in a pop-up windows but i can't put that variable from link in javascript. My problem is that <code>$i['itmid']</code> comes from databse and for every link the id is diffrent and js get only the last variable from that array. </p>

<p>Here is my code</p>

<pre><code>if($i['weapon'])
{
 $i['itmname']="&lt;a href onclick='javascript:poponload();'&gt;&lt;font color='red'&gt;*&lt;/font&gt;" .$i['itmname'] ."";

 echo " &lt;script type='text/javascript'&gt;

function poponload()
{


    testwindow = window.open('iteminfo.php?ID={$i['itmid']}', 'mywindow', 'location=1,status=1,scrollbars=1,width=500,height=500');
    testwindow.moveTo(400, 130);
    testwindow.focus;
}

&lt;/script&gt;";
</code></pre>
