PHP Pass variable to popup form within same page
<p>Following on from a previous question, (<a href="http://stackoverflow.com/questions/4866144/php-send-id-from-while-statement-to-popup-form">previous question here</a>), the problem I'm having seems to involve trying to pass/post a value through a form when the form action is '#'. I've tried session data but it always returns the last item from the database. Everthing else returns nothing.</p>

<p>Any help/ideas/advice greatly received, S. (Code below)</p>

<p>This is the code that displays the list of items, each containing an 'email' link/button to one instance of a popup window/form that is located at the bottom of the page. </p>

<pre><code>&lt;?php                   
$query = mysql_query("select * from istable where categoryID = '1'");       
while ($result = mysql_fetch_array($query)) {               
echo '&lt;h4&gt;'.$result['title'].'&lt;/h4&gt;
&lt;p&gt;'.substr($result['descrip'],0,408).'... &lt;a href="'.$wwwUrl.'/p/'.$result['categoryID'].'-'.$result['title'].'.php""&gt;&lt;strong&gt;Read more&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;form action="#" method="post" rel="#sheet" class="see"&gt;                                    
&lt;input type="hidden" name="propTitle" value="'.$propResult['title'].'"&gt;
&lt;input type="submit" name="submit" value="Email"&gt;
&lt;/form&gt; 
    ';        
} 
</code></pre>

<p>?> </p>

<p>This is the code for the popup window/form at the bottom of the same page that is called through jquery. </p>

<pre><code>&lt;div id="sheet" class="rounded"&gt;
  &lt;!--{{{ pane1 --&gt;
      &lt;div class="pane" id="pane1"&gt;
      &lt;h4&gt;Email Details to a Friend&lt;/h4&gt;            
      &lt;p&gt;You have selected to forward the details of &lt;?php echo $_POST['propTitle']; ?&gt; to a friend.&lt;/p&gt;
      &lt;p&gt;Please fill out the following form&lt;/p&gt;
          &lt;form class="rounded" id="email-form" method="post" action="&lt;?php echo $pageLink; ?&gt;"&gt; 
          &lt;!-- form goes in here --&gt;                 
          &lt;/form&gt;   
      &lt;/div&gt;
      &lt;!--}}}--&gt;                
  &lt;/div&gt;

    &lt;script type="text/javascript"&gt;         
    $(".see").overlay({mask: '#999', fixed: false}).bind("onBeforeClose", function(e) {
    $(".error").hide();
    });         
    &lt;/script&gt;   
</code></pre>
