Hi to everyone...
I'm having trouble migrating a working website to PHP 4.2.2 (it is working fine on a 3 series PHP).
This is a test code that gives the exact problem:
Please note I haven't escaped the quotes for easier reading...
file: SEND.PHP
<?php
echo "<form method="post" action="RECEIVE.PHP">";
echo "<select name="multdata[]" multiple size="10">";
for ($i=0; $i<10; $i++) {
echo "<option value="$i">$i</option>";
}
echo "</select>";
echo "<input type="submit" value="Send!"></form>";
?>
file: RECEIVE.PHP
<?php
$count = count($multdata);
echo "Counted $count items in array.<br>";
echo "Array Values:<br>";
for ($i=0; $i<$count; $i++) {
echo "$multdata[$i]<br>";
}
Now the problem is that this works fine on 3.x, but on 4.2.2, suppose for example I select items 1,2 and 3 from the multiple select, and the result I get is:
Counted 5 array items
Array values:
1
2
3multdata[]=1
2
3
Selecting only 1 item, correctly sends a 1 item array. Selecting 4 items returns a 7 item array with the same structure (1,2,3,4multdata[]=1,2,3,4)...etc...
What's happening?
PHP installation is Redhat 9 default... php.ini seems fine (although i'm no guru at this...)..., and this is a fresh OS install...
Thanks,
MK