maharg
Technical User
- Mar 21, 2002
- 184
Hi
I have a code which is basically a form containing a button, which has a value of $w, which I create in a loop, to make several copies of the form, each with a different value...
Basic form...
Form when in a loop...
I get an error due to the form action method containing a php snippet, and can't fathom out how to get round that.
Any suggestions would be much appreciated!
Thanks in advance,
Graham
I have a code which is basically a form containing a button, which has a value of $w, which I create in a loop, to make several copies of the form, each with a different value...
Basic form...
Code:
<tr>
<td style="background:transparent">
<form name="input" method="post" action="<?php echo $_SERVER['SCRIPT_NAME']?>">
<input type="hidden" name="id" value="1">
<input type="submit" name="submit" value="1">
</form> </td></tr>
Form when in a loop...
Code:
<?php
echo "<table><tr>";
$i=1;
while($i<=10)
{
$w=$i;
if ($w<10){$w=("00".$w);}
else if (($w<100)&&($w>9)){$w=("0".$w);}
else $w=$w;
$button='<td style="background:transparent">';
$button.='<form name="input" method="post" action="<?php echo $_SERVER['SCRIPT_NAME']?>">';
$button.='<input type="hidden" name="id" value="'.$w.'">';
$button.='<input type="submit" name="submit" value="'.$w.'">';
$button.='</form> </td>';
echo $button;
$i ++;
echo "</tr></table>";
?>
I get an error due to the form action method containing a php snippet, and can't fathom out how to get round that.
Any suggestions would be much appreciated!
Thanks in advance,
Graham