|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
passing array as post variable?
Hi. I have a question I would appreciate some help with.
I need to pass a couple of arrays, together with some info in a form to a page. I initially thought I might be able to pass the array on in a hidden form field. But its not working right. The data I get in the array on the other side is wrong. Does anyone know if this can be done? (passing an array as a post variable). If not, do you have any suggestions as to how I can do it? Thanks a lot Joe |
|
#2
|
|||
|
|||
|
__________________
Best Regards, Håvard Lindset |
|
#3
|
|||
|
|||
|
Thanks!! Thats a great suggestion. I've looked it up and it should work...
I'll give it a try. Thanks again Joe |
|
#4
|
|||
|
|||
|
posting an array
use the [] symbol in the name of the form field you are submitting like:
input type=text name=whatever[] value=a input type=text name=whatever[] value=b input type=text name=whatever[] value=c input type=text name=whatever[] value=d when you post, this will come in as $whatever = array("a", "b", "c", "d"); and you can access them like: $whatever[0] which will yield you "a" |
|
#5
|
|||
|
|||
|
Great. Thanks for that tip. I got it working using serialization, but I'll keep this in mind as well.
Joe |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > passing array as post variable? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|