Post-Vars doubled / corrupted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello to all,

I distributed my app to a new server and suddenly had values saved twice in the db and so on.
I tracked it down and found out, that the problem is the content of $_POST.
Vars are doubled, Strings corrupted. Absolutely absurd.
I have no idea where to search for the reasons.
PHP-Version is 4.3.11
Does anybody else have an idea?

Thank you in advance
Sabine


A simple testcase:

<?php
   echo "Post:";
   var_dump($_POST);
?>
<html>
<body >
<form id="formular" action="<?=$_SERVER['PHP_SELF'] ?>" method="post"> <ul id="colors"> <li><input class="buttons" name="colors[]" id="id1" type="checkbox" value="1" title="chose color" /><label for="id1">red</label></li> <li><input class="buttons" name="colors[]" id="id2" type="checkbox" value="2" title="chose color" /><label for="id2">blue</label></li> <li><input class="buttons" name="colors[]" id="id3" type="checkbox" value="3" title="chose color" /><label for="id3">green</label></li> <li><input class="buttons" name="colors[]" id="id4" type="checkbox" value="4" title="chose color" /><label for="id4">yellow</label></li>
       </ul>
<fieldset class="nolegend"> <input type="submit" value="change colors" name="aendern" />&nbsp;&nbsp;&nbsp;
               <input type="submit" value="save colors" name="speichern" />
</fieldset> </form> </body>
</html>

Output for $_POST, if you just click on "change colors":
Post: array(1) { ["aendern"]=> string(34) "change colorsaendern=change colors" }


Output, if you check only "red" and click "change colors":
Post: array(2) { ["colors"]=> array(1) { [0]=> string(1) "1" } ["aendern"]=> string(13) "change colors" }

output for 2 colors checked:
Post: array(2) { ["colors"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "2" } ["aendern"]=> string(13) "change colors" }

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux