got the following code: whats suppose to happen is that I get a POTST['listAll'] from flash. I then explode it by finding the commas in the POST string and convert this to an array.
I then add the array to the session array. This all works but the session does not keep adding, so when I add another page's products. The list is cleared and the Session get only added the new products?
i originally put a $latest .= in front of the array_push command but that didnt help.
any advise would be great 🙂 🙂
session_start();
if (!session_is_registered($_SESSION['old_products'])) {
session_register($_SESSION['old_products']);
$_SESSION['old_products'] = array();
}
if (!isset($latest)) {
$latest = array();
}
if ($_POST['listAll']) {
echo $_POST['listAll'] . '<br>';
/************************************
INPUT FROM FLASH IS SUCCESSFULL
***********************************/
if (!$holder) {
$holder = array();
}
$holder = array_unique(explode(',',$_POST['listAll']));
/*******************************************
NOW PUT ALL ITEMS INSIDE THE SESSION
******************************************/
foreach ($holder as $val) {
if (array_unique($holder)) {
array_push($_SESSION['old_products'],$holder);
}
}
foreach(latest as $val2) {
echo $val2 . '<br>';
}