I was never able to get this with php, but I do know that when I did it with aspx/c# My login control created a session handler, which basically was whether or not they were logged in. If they were not logged in, they would be redirected to the login page when trying to go to specific content...