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

Concat problem variable in key value of $_POST

P: 45
I have concat problem in post value......
it take string value $POST['chk$j']...
Expand|Select|Wrap|Line Numbers
  1. c
  2.  
  3. if(isset($_POST['update']))
  4. {
  5. for($j=1;$j<10;$j++)
  6. {
  7. $chkval=$_POST['chk$j'];
  8. $txtval=$_POST['txtamad$j'];
  9.  
  10. echo $dad;
  11. }
  12. print"<input type=\"submit\" name=\"update\" value=\"update\">";
  13.  
  14. while($dat=mysql_fetch_array($res))
  15.                 {
  16.                     $i++;
  17. print"<tr id=\"$i\" onclick=\"cll(id)\" >";
  18. print"<td><input type=\"checkbox\" name=\"chk$i\" value=\"$dat[0]\"></td>";
  19. print"<td><input type=\"text\" name=\"txtamad$i\" ></tr>";
  20.  
  21. }
  22.  
Feb 27 '08 #1
Share this Question
Share on Google+
4 Replies


ronverdonk
Expert 2.5K+
P: 4,258
Reading your code I have some doubts, but I still have no clue as to what your problem is. Concat of which variables where in the code?

Please try to describe your problem in a more extensive way.

Ronald
Feb 27 '08 #2

P: 45
Reading your code I have some doubts, but I still have no clue as to what your problem is. Concat of which variables where in the code?

Please try to describe your problem in a more extensive way.

Ronald

concat $_POST['chk$j'] here is my problem that is variable $j not concat with chk it take string value instead of chk1,chk2......but it take chk$j,chk$j.....

so how to cancat the $j varible with chk.....
Feb 27 '08 #3

Markus
Expert 5K+
P: 6,050
Try this:
[php]
$_var = $_POST['some_name' . $_g];
[/php]
Feb 27 '08 #4

ronverdonk
Expert 2.5K+
P: 4,258
concat $_POST['chk$j'] here is my problem that is variable $j not concat with chk it take string value instead of chk1,chk2......but it take chk$j,chk$j.....

so how to cancat the $j varible with chk.....
Use [php]$chkval=$_POST['chk'.$j];[/php]Ronald
Feb 27 '08 #5

Post your reply

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