English is not my native language; please excuse typing errors.
I have a very strange problem with a PHP code, using checkbox arrays. It is a simple checkbox code in a real site in Russian language, where I help to my frend to fix: http://astrabis.ru/teoria/test2.php
The host has the PHP Version 5.3.13.
But this code, YES, works in my local PC (Windows 7, with installed Xamp Appache) PHP Version 5.6.3. I has been installed the PHP server to debug the problem that I describe here.
Problem description. The check boxes in the file test2.php is shown perfectly on a browser, but when I check some of them and press Submit, the server does not move any data to testrez2.php file that processes the data.
Details. In file test2.php there are three arrays of check boxes: vata[] pita[] kapha[] The test2.php code fragments:
<!DOCTYPE html>
<html>
<head>
...
<meta http-equiv=Content-Type content="text/html; charset=windows-1251" /><meta name=viewport content="width=device-width, initial-scale=1" />
...
</head>
...
<form action="http://www.astrabis.ru/teoria/testrez2.php" method="post">
...
<table cellspacing="1px">
<tbody>
<tr><td rowspan="3">????</td><td><input name="vata[]" type="checkbox" value="2">???????, ??????????; ???????????, ??????????? ?? ???????? ?????????, ???????????? ????????, ??????? ? ??? ?????? ? ? ??? ??????.</td></tr>
<tr><td><input name="pita[]" type="checkbox" value="2">???????????, ?????????????????, ????????????, ?????? ????, ????? ???????. ???????????? ???. ???????????? ???????? ? ????, ???? ??????? ??????? ???? ?? ????????????????? ????????.</td></tr>
<tr><td><input name="kapha[]" type="checkbox" value="2">?????????, ??????, ??????????, ?? ???????????? ???????.</td>
...
...
<tr><td rowspan="3">?????</td><td><input name="vata[]" type="checkbox" value="2">??????????? ? ????? ? ???????????.</td></tr>
<tr><td><input name="pita[]" type="checkbox" value="2">??????????? ? ?????????? ???????????, ?????? ?????????.</td></tr>
<tr><td><input name="kapha[]" type="checkbox" value="2">??????????? ? ????????????? - ????????,???????? ? ?.?.</td>
</tr>
</tbody>
</table>
The file of the result processing, testrez2.php, has some simple matematic, but I added some debug code to see the input data and other info The testrez2.php code fragments:
...
<?php
echo "<br>vata : ";
print_r(array_values($_POST['vata']));
echo "<br>pita : ";
print_r(array_values($_POST['pita']));
echo "<br>kapha : ";
print_r(array_values($_POST['kapha']));
$x=0;
$y=0;
$z=0;
if (isset($_POST['vata']))
{$x=array_sum($_POST['vata']);}
if (isset($_POST['pita']))
{$y=array_sum($_POST['pita']);}
if (isset($_POST['kapha']))
{$z=array_sum($_POST['kapha']);}
$sum=$x+$y+$z;
//debug
echo "<br>x : $x";
echo "<br>y : $y";
echo "<br>z : $z";
echo "<br>sum : $sum";
More of that, historically, I started to debug another file from the site and added the same code in a file testrez3.php, (it is activated by test3.php of the same real url). It is the same debug printing code that is shown in the file testrez2.php above.
The pair test3.php and testrez3.php are worked several days and stopped with the same problem!
I also shanged the method from POST to GET in files test2.php testrez2.php (). I wanted to see in the address line of my browser Chrome that the checkbox data is really sent to the server. It is sent! But the testrez2.php also does not receive any data.
See below the match of two "gets": real site and my PC local host
localhost/astrabis/astrabis.ru/test/testrez2.php?vata%5B%5D=2&pita%5B%5D=2&kapha%5B%5D=2&vata%5B%5D=2&pita%5B%5D=2&kapha%5B%5D=2
astrabis.ru/teoria/testrez2.php?vata%255B%255D=2&pita%255B%255D=2&kapha%255B%255D=2&vata%255B%255D=2&pita%255B%255D=2&kapha%255B%255D=2