passing a parramter from php to javascript back to php
<p>I have a php page, which using javascript, creates a popup window which contains another php page. the php page in the popup window is basically a form, and will use that value to insert into a database. Using the following function to load the php page in a popup:</p>

<pre><code>phppopup('edit_status.php?cmd=EditStatusData')

function phppopup(page){
child1 = window.open (page, "Ebay Auctions", "height=600,width=600,status=yes,toolbar=no,menubar=no,location=no");
child1.document.close(); 
}
</code></pre>

<p>How can i pass a value from the calling page to the page in the popup?</p>

<p>I am trying at the moment:</p>

<pre><code>echo "&lt;p&gt;&lt;a href=\"#\" onclick=\"updateByEdit('". $username ."', '". $subcat ."')\"&gt;Edit User Info&lt;/a&gt;
&lt;p&gt;&lt;a href='#' onclick=\"makewindows2('edit_status.php?cmd=EditStatusData&amp;pk=". $pk ."'); return false;\"&gt;Historie&lt;/a&gt;;
</code></pre>

<p>Which generates the following html:</p>

<pre><code>&lt;a href="#" onclick="updateByEdit('trendsandbrands', 'fakeapproved')"&gt;Edit User Info&lt;/a&gt;
&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;strong&gt;&lt;strong&gt;&lt;strong&gt;&lt;a href="#" onclick="phppopup('edit_status.php?cmd=EditStatusData&amp;amp;pk='); return false;"&gt;Historie&lt;/a&gt;
</code></pre>

<p>It works fine for updateByEdit, why not for phpopup?</p>

<p>$pk is just an integer, which display fine in the page it the window is called from.</p>
