Not able to get $_POST assigned to a variable PHP -
Not able to get $_POST assigned to a variable PHP -
i assume have stupid happening due lack of experience.
on form on members.php have:
$column = 0; echo "<form name =member method =post action = individual.php>"; echo "<table>"; echo "<tbody>"; while($row = $rs->fetch_assoc()) { if ($column == 0) { echo "<tr>"; } echo '<td><input type = submit name="'. $row['num'].'" value ="'. $row['name'].'" id=submit></td>'; $column++; if ($column >= 5) { echo "</tr>"; $row++; $column=0; } } echo "</tbody>"; echo "</table>"; echo "</form>";
on individual.php have
print_r($_post);
with result beingness array ( [16] => luke )
expected.
but when seek
$name=$_post['name']; $num=$_post['num']; echo "<br>".$name." ".$num."<br>";
i not results.
i want $row['num']
did ['name']
create sure didn't transpose trying achieve.
i want take selected on previous form , insert a
select * table number=$num;
the name of input fields not num
, name
, instead, values of these 2 keys in array $row
. why unable retrieve these values on backend.
change code to:
<input type="hidden" name="name" value="<?php echo $row['name']; ?>;"> <input type="hidden" name="num" value="<?php echo $row['num']; ?>;"> <input type="submit" value="submit!" name="submit_form">
php
Comments
Post a Comment