OK, I figured out how to get this to work on a IIP 4.3 page in a dir other than UBBT, put the above code towards the bottom of the page, just after:
code:
include "include/footer.php";
This will prevent the code from conflicting with the IIP info, which I am guessing there is a similarly named variable somewhere that is conflicting. But the code at the end seems to work fine so far. The IIP page already has the user verified, so there is no need to do it again.