#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    754
    Rep Power
    123

    Accessing Form values


    I have this form
    <form name="my_grades" action="report.php" method="POST">
    <table>
    <tr><td><input type="text" value="1"></td></tr>
    </table>
    <input type="submit" name="justdoit" value="Save">
    </form>
    and the following php code to display the POST variables
    foreach($_POST as $var_name => $value) {
    print $var_name .", " . $value . "<br>";
    }
    but it only displays the button. I am expecting to display the button and the contents of the <input> field. What am I doing wrong here?
    Thanks,
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    754
    Rep Power
    123
    Oy! I forgot the name="" in the fields...

    Comments on this post

    • ManiacDan agrees

IMN logo majestic logo threadwatch logo seochat tools logo