Thanks for being so patient with me! I know it is taking me a while to catch on.
I changed my function to this:
function InsertItem($Item){
global $Array;
$_SESSION['Array'][] = $Item;
$Array = $_SESSION['Array'];
}
I realized I didn't have to do all that work! And everything still works.
As for deleting things here is my script for that:
if(IsSet($delete_item) && is_array($delete_item)){
$count = count($delete_item);
echo "<br>You have selected " . $count. " items to delete!<br><br>\n";
for($j=0; $j<$count; $j++){
$Arraylength = count($Array);
for($z=0; $z<$Arraylength; $z++){
$k = $j+1;
if($Array[$z] == $k){
print("The item to delete is $z is $Array[$z]");
unset($GLOBALS['Array'][$z]);
}
}
}
}
It is working, except I have to refresh the page for it to show up. Is there a way to get around this? I have it where the page refreshes itself when the submit button is clicked but I still have to refresh it again to see that something has been deleted.
Thanks again for you help!!!! 🙂