Hi again,
I have a for loop that generates forms on the same page. There is a button in each form that updates data for that form. The number of forms generated is unknow as it depends on how many rows where returned from the sql query. Each form that is generated has it's own "hidden set" field with a generated name. (like this: form1, form2, form3, form4....ect)
This is what I have:
<?php
if(isset($_GET["$formName"]))
{
//Success!
}
else
{
for($i=0; $i < $rows; $i++)
{
$formName = "form".$i."";
print "
<form method="get" action="page.php">
<input type="hidden" name="$formName" value="set">
<input type="submit" value="Update" >
</form>";
}
}
?>
The page shows all the forms properly, with correct data on each form. but when I press the update button on one of the forms, it doesn't work. It looks like it can't see the value $formName in the if(isset($_GET["$formName"]))
How can I get this to work?