Ok, this one is so simple but it’s got me completely stumped. Can anyone explain this odd behavior?
Simple script runs in response to a web form. At this point I’ve reduced this down to the minimum, I’m actually NOT even doing anything with the form data at this point. The reduced pattern still stumps me,
[php]
echo(‘START…
’);
$bResult = true;
$callscriptOK = false;
$uploadOK = false;
echo(" - bR is [$bResult]
");
if ($bResult) {
echo(’ - Passed $bResult is True
’);
}
echo(“uploadOK = $uploadOK
”);
echo(‘uploadOK = ‘.$uploadOK.’
’);
[/php]
Two conditions. Set, $bResult to true or false. As listed, true, returns,
[tt]
START…
- bR is [1]
- Passed $bResult is True
uploadOK =
uploadOK =
[/tt]
setting $bResult to false,
[tt]
START… - bR is []
uploadOK =
uploadOK =
[/tt]
The greater problem was, $bResult represents a call to another function, when that was returning false, the value of other variables looked corrupted. $uploadOK appeared corrupted yet, when the function return was true, $uploadOK was all good! I’ve reduced this to the bare minimum, but either way $uploadOK is dead. And $bResult (or $bR for short) only displays when it’s true! I’m stumped.
Thanks a million for any clarification here.
Jim