MyBB Community Forums

Full Version: How to protect my added php from guest
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello..need some help..

i have a php file and i add this to my forum,

it something like this.
this is mybb file
www.mysite.com/forum/mybb files


this is my file
www.mysite.com/forum/myfile.php

i want only users can view this.like mybb setting when forum viewable only by registered members.

if guest trying to put this www.mysite.com/forum/myfile.php on his browser, i want to prompt the login page before he can access or view that page.

what code should i add?

sorry for my englsih.. hope you understand..
nevermind i've figure it out by adding this code..

// No permission for guests
if(!$mybb->user['uid'])
{
	error_no_permission();
}