User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,926 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,368 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1200 | Replies: 1
Reply
Join Date: Aug 2006
Posts: 999
Reputation: EnderX is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
EnderX EnderX is offline Offline
Posting Shark

Arrays within $_POST[]?

  #1  
Oct 18th, 2006
For a program I'm working on, I need to do the following:

1. Starting with a single set of fields in a form, I need to be able to dublicate them (multiple identical form entries) without necessarily knowing how many there will be. I managed to do this, by incrementing a session variable each time the appropriate form button was clicked, then putting the form-building stages inside a for loop that runs until it hits that variable's limit. Assuming I'm reading this correctly, what I've done leaves me with a set of arrays; one for each of the form fields.

2. Now, however, I need to be able to redisplay these fields back to the screen afterwards. I'm having trouble with this, because I can't figure out how to get the $_POST[] command to recognize my internal array. Every time I've tried so far, I've gotten errors. Is this even possible, and if so, how is it coded?

Thanks in advance,
-EnderX
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2006
Location: NYC
Posts: 133
Reputation: sn4rf3r is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 2
sn4rf3r's Avatar
sn4rf3r sn4rf3r is offline Offline
Junior Poster

Re: Arrays within $_POST[]?

  #2  
Oct 18th, 2006
can you run
[php]
print_r($_POST)
[/php]
that will display the array, then you can refer to the embedded array like
[php]
$_POST['myarray']['anotherarray']['yetanotherarray']
[/php]
make sence?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 11:55 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC