Welcome Guest, Not a member yet? Register   Sign In
Saving checkboxes
#11

[eluser]marlar[/eluser]
He doesn't print the array with an echo alone, he uses print_r() which is meant to do exactly that:

echo "<pre>".print_r($_POST,1)."</pre>";

So that is not the problem.

Easymind, you could also try: var_dump($_POST);

But remember to check at least one of the checkboxes or you won't see anything!
#12

[eluser]easymind[/eluser]
Ok well, these are all good tips for people wanting to check a variable for arrays. And indeed, I should not forget to check a box or two. But the array is there in my $_REQUEST vars and not in my $_POST vars. And it seems the link I posted above in the second post of this thread has exactly the same problem. So my conclusion is that the SERVER at my webhost is configured to restrictive or just plain inadequate. And my solution is using the $_REQUEST string. And if I want to be sure I don't get the $_GET variables I could do:
Code:
$ids_categories=$_POST?$_REQUEST['id_categories']:false;
But thanks for the replies. I could check for you what server exactly is running and if the problem is known, but... who cares. They will learn or get extinct Smile


-----

I just realized I posted a link to a dutch language site, so let me translate the main point:

Quote:I just ran into the same problem as the topic strater. The real problem is that on 'some servers' an array of checkboxes gets saved with the value 'Array' (pure string), which cannot be read by any means. But in $HTTP_POST_VARS and $_REQUEST the values are stored correctly.

The server on which it goes wrong at my end is running Plesk 7 reloaded, so apache. It is a strange bug for which I cannot find any information. (Except for others having the same issue)




Theme © iAndrew 2016 - Forum software by © MyBB