// NEW 11/27/2006: FINALLY, IF YOU ADDED OR DELETED OR DID ANY KIND OF FORM ACTION SUCCESSFULLY, DON'T RE-DISPLAY THE NEW EXPENSE ITEMS VIA $_POST
if ($_POST['hasUpdatedLease'] && (!is_array($leaseObj->errorArray) || @sizeof($leaseObj->errorArray) == 0)) {
print_r(array_keys($_POST));
@reset($_POST);
$tempPost = $_POST;
foreach ($_POST as $key => $val) if (strpos($key, 'new_') === 0) array_remove($tempPost, $tempPost[$key]);
@reset($_POST);
$_POST =& $tempPost;
print_r(array_keys($_POST));
}
For some reason, even though the condition is always met when I click any of the form submit images, the following "weird behavior patterns" occur:
1) If I click the "Add" submit image, all $POST values whose keys start with "new" should be removed from $POST. However, $POST['new_audited'] and $_POST['new_reoccuring'] remain
2) If I click the "Delete" submit image, all $POST values whose keys start with "new" should be removed from $POST. However, ALL of them remain in $POST untouched!
I can verify that I enter the conditional block by my arrays appearing on screen every time.
Any reason why this is happening that I missed?
Thanx
Phil