How to post value using loop

KYcandra

New Member
I am facing the problem to post the value of form when using while or for loop.Here is my code.\[code\]<form name="frm1" id="frm1" method="post" enctype="multipart/form-data"><?phpfor($i=0;$i<5;$i++){?> <a href="http://stackoverflow.com/questions/3871956/#" onclick="return test1();">Test<?php echo $i;?></a> <input type="hidden" value="http://stackoverflow.com/questions/3871956/<?php echo $i;?>" name="var" /><?php }?></form>\[/code\]And i have used this javascript\[code\]<script type="text/javascript">function test1(){ document.frmviewer.method="post"; document.frmviewer.action="page2.php"; document.frmviewer.submit();} </script>\[/code\]Now i want to get the value of tag means "Test1" in page2.php page with hidden variable.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.Thanks in advance.Kanji
 
Back
Top