By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

how to select post values in php when it in loop

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

Expand|Select|Wrap|Line Numbers
  1. <input type="hidden" name="name" value="<?php echo $name; ?>" />
  2.  <textarea name="Comment"> </textarea>
  3.  <input type="submit" name="submit" value="Add Comment" style="margin-left: 225px;"/>
Dec 23 '11 #1

✓ answered by Dormilich

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).

Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
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).
Dec 23 '11 #2

P: 5
yes u r right but ,

how can i obtain textarea value , when perticular submit button is click....?
Dec 26 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.