I am using sessions to store things into an array and save them. The program that I am working on goes from Flash to php. The php file stores values from the Flash program into an array. The first time you see the php page it won't print the array. The second time it shows everything in the array, and everytime after that.
I am making a shopping cart. This is part of the code to give you an idea of what I am doing:
index.php:
//I post variables from flash in this file
StoreTextInfo($ItemNumber, $price, $details);
//global.php
function StoreTextInfo($ItemNumber, $price, $details){
if(!IsSet($_SESSION['Array']))
{
$_SESSION['Array'] = array($ItemNumber, $price, $details);
$Array= $_SESSION['Array'];
}
else{
$Array = $_SESSION['Array'];
array_push($Array,$ItemNumber, $price, $details); $_SESSION['Array'] = $Array;
}
return $Array;
}