Reply to Re: Variable variable name in $_POST ?

Your name:

Reply:


Posted by ljb on 12/05/05 03:21

usenet@isotopeREEMOOVEmedia.com wrote:
> PHP 4.2.2
> Apache 2.0.40
>
> My script receives values for several values :
> _POST["c1"] = "a"
> _POST["c2"] = "b"
> _POST["c3"] = "c"
> _POST["c4"] = "d"
>
> The number of vars posted changes however, so I need to access the $_POST
> variables using a loop. I figured I could accomplish using one of these
> assignments, but apparently I'm wrong :
>
> $i = 1;
> $h = 7; // this varies, based on a database record
>
> while ($i <= $h) {
> $c{$i} = $_POST['$c{$i}'];
....

I think you want: $_POST["c$i"]

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация