Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: $_POST arrays problem... |
|
Author |
|
Carbofos
Joined: 12 Dec 2006 Posts: 2
|
Posted: Tue 12 Dec '06 13:32 Post subject: $_POST arrays problem... |
|
|
Hi, I'm experiencing a problem with sending arrays with 'post' method. It seems the data are being truncated, for example I have a number of checkboxes with the name "mark[]" and values like "123", "456", "789".
When I submit the form, here's what I get:
results in:
Code: | array(1) { ["mark"]=> array(3) { [0]=> string(1) "3" [1]=> string(1) "6" [2]=> string(1) "9" }} |
It seems like only the last character is in the array. I used HTTP header viewer to check what's being sent from my browser and it's ok there, it sends the full data...
I put this 'var_dump' to the very first line of a file so nothing should have a chance to modify data (I've also got 'output_buffering' off in php.ini)
When I do the same on another machine, it's working as expected, of course.
So I think it's either apache or php might be configured incorrectly.
Can anyone give me some directions on where to search? Thanks in advance. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7360 Location: Germany, Next to Hamburg
|
Posted: Tue 12 Dec '06 20:33 Post subject: |
|
|
How does the put look like when you use
Code: |
print_r($_POST['mark']);
|
|
|
Back to top |
|
Carbofos
Joined: 12 Dec 2006 Posts: 2
|
Posted: Wed 13 Dec '06 14:18 Post subject: |
|
|
James Blond
It looks very similar, except there weren't data type names, doing something like:
Code: | echo $_POST['mark'][0] |
gives the same one-letter result...
Anyway, what I did is I wiped everything and reinstalled from scratch and now it's working
So I guess the topic may be closed, unless someone else has the same problem and doesn't want to solve it the same way as I did.
Thanks for your help! |
|
Back to top |
|
|
|
|
|
|