Hi,
I'm trying to pass an array between two different .php files using sessions, as shown in the files below. File 1 writes the array into the session variable, and file 2 reads the array from this variable.
However, the output of file 2 is not the contents of the array ... .
Does anyone have an idea how to solve this problem? Thanks a lot in advance.
FMe
File 1: write array into $_SESSION
<?
...
// c is an array with dynamic length
session_start();
for ($i=0; $i<count($c); $i++) {
$SESSION["i"] = $c[$i];
echo $SESSION["i"];
}
?>
File 2: read array from $_SESSION
<?
session_start();
for ($i=0; $i<count($SESSION); $i++)
{
echo $SESSION["i"];
}
?>