Okay, I didn’t post the code right.. I’m new at this 🙁 Sorry.
Did you ever figure this out? This is the same thing I am trying to do!
That worked great! I modified it- put a link to the login page after <?php else ?> – and I got what I needed. Thanks so much for your help 🙂