in reply to Automatic redirect with a pause

I'm not sure that code works as you intend; on my installation, redirect() sends a HTTP Status 302 header. You've already sent a 200 OK header.

You could use sleep, or you could send a meta refresh tag. I would think the latter would work better with your existing code.