how do I get user id from radio button name in an array. The value is a variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Drummin

    #1

    how do I get user id from radio button name in an array. The value is a variable

    How do I get user id from radio button name in an array. The value is a variable. So this section repeats in an array and when submitting the ID and value is passed for each user in the array.
    Code:
    echo "<tr>";
    echo "<td>$userlast&nbsp;$userfirst</td>";
    echo "<td><input type='radio' name='$userID' value='t' /></td>";
    echo "<td><input type='radio' name='$userID' value='u' /></td>";
    echo "<td><input type='radio' name='$userID' value='e' /></td>";
    echo "<td><input type='radio' name='$userID' value='p' checked /></td>";
    echo "</tr>";
    For example [26]=> t[35]=>p is passed when submitting.

    How do I get the ID value in $_POST?
  • Shenno
    New Member
    • Sep 2010
    • 59

    #2
    i think u need to re-format your Q..

    if u wanna pass an array save post array in another php array..

    then u can access members as usual.

    $arr=$_POST['pass_array'];

    echo $arr['0'];

    Comment

    Working...