My code is
<form action="test.php" name="test">
<?php foreach($result as $res)
{
?>
<div>
<label><?php echo $res->name;?></label>
<input type="text" name="<?php echo $res->val;?>">
<input type="submit" value="submit" />
</div>
<?php }
?>
</form>
I need the same action for each submit button, whenever user clicks on it the action test.php should be called.
I have tried like this but it doesn’t work. Please help.
For each submit, you need a different form. Here you go: