I have a submit buttom like this:
<?php
echo "<form id='abottom' method='post'>
<button name='".$row3[$ww]."' id='".$row3[$ww]."' type='button'>More Details</button>
<input type='hidden' name='action' value='".$row3[$ww]."' />
</form>";
?>
and ids are working right of the buttons of the table rows (by Firebug). But when I want to output $_POST in a query while loop, then no one of those works for me:
<?php
echo $_POST[$row3[$ww]]." <br />";
echo $_POST['$row3[$ww]']." <br />";
echo $_POST[$row3['$ww']]." <br />";
echo $_POST["$row3[$ww]"]." <br />";
echo $_POST[$row3["$ww"]]." <br />";
echo $_POST[$row3['".$ww."']]." <br />";
?>
Which one will be the right? Those above didn’t work for me.
$row3 // is a fetch result of sql3
$ww // is table rows name on which one is selected
Raw HTML output example:
<form name ='dets' method='POST'>
<input class = 'showt' name ='6' id ='6' type='button' value= 'More Details'></input>
<input type='hidden' name='data' value='6' />
<noscript><input type='submit' value='Submit'></noscript>
</form>
Much better for debugging and finding the correct variable would be to use
to see which variables arrive at your script.
Update:
I think, what you need is:
And if you have several values in
$row3then add extra forms like this:Always keep the name of the hidden input the same (
data)!