I have a page generated by a php script that creates n tables each with their own submit button
echo "form type='POST' target='secondphppage.php'";
for $i=0 to n
echo "<input type='submit' value='button$i'>";
echo "<input type='hidden' name='queryarray[]' value='$myquery'>";
The target php script does
$queryarray=$_POST[queryarray];
I can then pick up the array of queries with ease $query=$queryarray[3] but how best to pass the information on which submit button was pressed? i want to be able to say $query=$queryarray[$buttonnumber];
(appologies the example above is in franglais code I cannot remember php syntax without it in front of me)
I just need a pointer on how to do it - do I generate multiple forms ? can I pass something on the url as in target='secondphppage.php?buttonnumber=3' and do a get as well as a post ?
am I just missing the plot is there an obvious way to do this ?
Thanks in advance
echo "form type='POST' target='secondphppage.php'";
for $i=0 to n
echo "<input type='submit' value='button$i'>";
echo "<input type='hidden' name='queryarray[]' value='$myquery'>";
The target php script does
$queryarray=$_POST[queryarray];
I can then pick up the array of queries with ease $query=$queryarray[3] but how best to pass the information on which submit button was pressed? i want to be able to say $query=$queryarray[$buttonnumber];
(appologies the example above is in franglais code I cannot remember php syntax without it in front of me)
I just need a pointer on how to do it - do I generate multiple forms ? can I pass something on the url as in target='secondphppage.php?buttonnumber=3' and do a get as well as a post ?
am I just missing the plot is there an obvious way to do this ?
Thanks in advance