![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2004
Posts: 1
Rep Power: 0
![]() |
Greetings, everyone! This is my first post, just running into a brick wall with some code I'm writing, having a hell of a time, and I found this site, so I thought I'd float the question here.
I have some JavaScript I wrote that opens an HTTP request to a php page, then inserts the product of the PHP into the current page, so that the page doesn't need to refresh in order to run the script. Entries from the PHP page get added to a table in the HTML, and they get assigned a unique identifier. Trouble is, when I finally submit the form after all the items are entered, I don't know how many there will be. So I did a foreach loop to go through the post variables, but I can't get it to give me the variables from $_POST dynamically. Basically, what I am trying to do is this: $varValue = $_POST['item_'.$count]; Where I can dynamically get the value out of post. Is this even possible? ~A! |
|
|
|
|
|
#2 |
|
Programming Guru
![]() |
foreach($_post as $col => $val)
if(substr($val, 0, 5) == "item_") {
$varValue = $val;
/* .. Do stuff .. */
}
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|