The following code was working, not sure the version of PHP that I was using, but I know it worked on 4. Rrecently my host upgraded to PHP Version 5.2.13, and all of the code is broken.
I have an HTML Form Submit.
My HTML Form POST the following variable "requirements" as 2D array data fine, which I can see in the HTTP POST via HTTPAnalyzer.
Here is the data from the POST
In PHP I am doing the following which no longer seems to work.
Usually, requirementsDelimted would be "1;2;3" and "4;5;6"
Now what is happening is only 1 iteration is happening for each loop, and requirements[0] is an array of length 1 with no value at requirements[0][0]
Thoughts? Workarounds?
I'm not saying the code is pretty, but this has been in place for 5 years and stopped working just recently.
Thanks,
Chris
I have an HTML Form Submit.
My HTML Form POST the following variable "requirements" as 2D array data fine, which I can see in the HTTP POST via HTTPAnalyzer.
Here is the data from the POST
Code:
requirements[0][] = 1
requirements[0][] = 2
requirements[0][] = 3
requirements[1][] = 4
requirements[1][] = 5
requirements[1][] = 6
In PHP I am doing the following which no longer seems to work.
Code:
$requirements[][] = $_POST['requirements[][]'];
$_SESSION['requirements'] = $requirements;
...
for($i=0;$i<=$requirementArrayCount;$i++)
{
$requirementsDelimited = '';
for($x=$i;$x<$i+1;$x++)
{
for($j=0;$j<count($requirements[$x]);$j++)
{
$requirementsDelimited = $requirementsDelimited.";".trim($requirements[$x][$j]);
}
}
// do something with requirementsDelimited
}
Usually, requirementsDelimted would be "1;2;3" and "4;5;6"
Now what is happening is only 1 iteration is happening for each loop, and requirements[0] is an array of length 1 with no value at requirements[0][0]
Thoughts? Workarounds?
I'm not saying the code is pretty, but this has been in place for 5 years and stopped working just recently.
Thanks,
Chris