Secure a Page


New member
I'd like to upload a static php page (secured.php) into the root directory and if people were to go this, I'd like it to only allow users who are logged into the forum, and if they aren't logged it, it will display a message saying they must login first.

Is there a code snippet I can utilize that I can put at the top of my page that will check to see if the user is currently logged in?


XenForo moderator
Staff member
Have you considered using a Page node?

Although it won't be in the root, they support php callback and you can apply permissions based on user or user group.