I have a shopping cart page that allows a user to type in a new
quantity and press a [Submit] button. The quantities entered are in form
text boxes with the names "item302", "item7812", etc. reflecting which
item that particular textbox is associated to. I store the entered
variables using 'import_request _variables("p", "p_")' so I end up with
$item302, $item7812, etc. My script looks for these variables by looking
through the shopping cart array which stores the item numbers themselves
and then checks the value of $item<whatever> .
If I have a number stored in $item is there any easy way to tell PHP
to check the value of variable $p_item<item>?
For example, if $item is '302' how can I tell PHP to evaluate $p_item302?
Thank you!
--
- Michael J. Astrauskas
P.S. I'm currently doing this using the eval() function, but I don't
like that technique.
quantity and press a [Submit] button. The quantities entered are in form
text boxes with the names "item302", "item7812", etc. reflecting which
item that particular textbox is associated to. I store the entered
variables using 'import_request _variables("p", "p_")' so I end up with
$item302, $item7812, etc. My script looks for these variables by looking
through the shopping cart array which stores the item numbers themselves
and then checks the value of $item<whatever> .
If I have a number stored in $item is there any easy way to tell PHP
to check the value of variable $p_item<item>?
For example, if $item is '302' how can I tell PHP to evaluate $p_item302?
Thank you!
--
- Michael J. Astrauskas
P.S. I'm currently doing this using the eval() function, but I don't
like that technique.
Comment