RE: [PHP] Dynamic variables (with method=post)
| From: | John W. Holmes | Date: | Thu, 20 Mar 2003 02:53:58 +0000 |
| Subject: | RE: [PHP] Dynamic variables (with method=post) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140391@lists.php.net to get a copy of this message | ||
> How do i receive dynamic variables with POST ?
> Please, see the code fragment.
>
> $ped_item = mysql_result($result, $j, 0);
>
> <form name=form_$ped_item method=post action=pedido.php>
> <input type=hidden name=upd_item value='$ped_item'>
> <input type=text size=7 maxlength=7 value=$ped_qtde
> name=quantidade$ped_item>
> </form>
>
>
> "upd_item" was usually received.
> How do i receive "quantidade$ped_item" ?
>
> I have tried:
>
> $p1 = $_POST['upd_item']; // this is OK !
> $p2 = $_POST['quantidade$upd_item']; // this doesn't work !
I guess it would be
$p2 = $_POST['quantidade'.$p1];
if I'm reading correctly...
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/