how to select post values in php when it in loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dinesh2464i
    New Member
    • Dec 2011
    • 5

    how to select post values in php when it in loop

    the following code is in loop of variable $name;
    I want to collect $_POST['comment'] value for particular variable $name when submit button hit.

    Code:
    <input type="hidden" name="name" value="<?php echo $name; ?>" />
     <textarea name="Comment"> </textarea>
     <input type="submit" name="submit" value="Add Comment" style="margin-left: 225px;"/>
    Last edited by Dormilich; Dec 23 '11, 09:10 AM. Reason: please use [CODE] [/CODE] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    if that HTML code occurs repeatedly in your form, then only the last instance will be available (because all the previous values were overwritten).

    also note that $_POST['comment'] does not equal $_POST['Comment'] (PHP is case-sensitive for variable/key names).

    Comment

    • dinesh2464i
      New Member
      • Dec 2011
      • 5

      #3
      yes u r right but ,

      how can i obtain textarea value , when perticular submit button is click....?

      Comment

      Working...