How to post value using loop
<p>I am facing the problem to post the value of form when using while or for loop.</p>

<p>Here is my code.</p>

<pre><code>&lt;form name="frm1" id="frm1" method="post" enctype="multipart/form-data"&gt;
&lt;?php
for($i=0;$i&lt;5;$i++)
{
?&gt;
    &lt;a href="#" onclick="return test1();"&gt;Test&lt;?php echo $i;?&gt;&lt;/a&gt;
    &lt;input type="hidden" value="&lt;?php echo $i;?&gt;" name="var" /&gt;
&lt;?php 
}
?&gt;
&lt;/form&gt;
</code></pre>

<p>And i have used this javascript</p>

<pre><code>&lt;script type="text/javascript"&gt;
function test1()
{
    document.frmviewer.method="post";
    document.frmviewer.action="page2.php";
    document.frmviewer.submit();
}   

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

<p>Now i want to get the value of  tag means "Test1" in page2.php page with hidden variable.</p>

<p>I am able to do it with passing value in javascript but i do not want to pass any variable in javascript and also do not want to pass any variable in url.</p>

<p>Thanks in advance.</p>

<p>Kanji</p>
