I fear there's no possibility to handle that with pure PHP then.
my suggestion: in the if-statement echo() a formular with your new
script as action= and a name="fw_form" (or sth else)
then insert a small javascript section, which performs a
document.fw_form.submit() (hope that's correct)
if you want, you can even pass data in this form, by using hidden
fields
i'm not that familiar with JS, just play a bit around