[PHP]
// 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['hasUpdatedLeas e'] && (!is_array($lea seObj->errorArray) ||
@sizeof($leaseO bj->errorArray) == 0)) {
print_r(array_k eys($_POST));
@reset($_POST);
$tempPost = $_POST;
foreach ($_POST as $key =$val) if (strpos($key, 'new_') === 0)
array_remove($t empPost, $tempPost[$key]);
@reset($_POST);
$_POST =& $tempPost;
print_r(array_k eys($_POST));
}
[/PHP]
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
// 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['hasUpdatedLeas e'] && (!is_array($lea seObj->errorArray) ||
@sizeof($leaseO bj->errorArray) == 0)) {
print_r(array_k eys($_POST));
@reset($_POST);
$tempPost = $_POST;
foreach ($_POST as $key =$val) if (strpos($key, 'new_') === 0)
array_remove($t empPost, $tempPost[$key]);
@reset($_POST);
$_POST =& $tempPost;
print_r(array_k eys($_POST));
}
[/PHP]
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
Comment