Page 1 of 1

Check if user is logged on

Posted: Sun Oct 19, 2008 10:18 pm
by wiiboy
I just followed the tutorial here
It shows how to integrate a forum software into a website. But, I don't know PHP, so I don't know how to check whether a user is logged in or not on each page. Can someone show me how?

Re: Check if user is logged on

Posted: Sun Oct 19, 2008 10:35 pm
by requinix
wiiboy wrote:It shows how to integrate a forum software into a website.
It does?

Code: Select all

if($mybb->user["uid"])
Looks like the kind of thing you need.

If you want to use PHP then I've got great advice for you: learn the language.

Re: Check if user is logged on

Posted: Sun Oct 19, 2008 10:39 pm
by wiiboy
tasairis wrote:If you want to use PHP then I've got great advice for you: learn the language.
I'm working on it. . . :mrgreen:

Re: Check if user is logged on

Posted: Mon Oct 20, 2008 3:46 am
by aceconcepts
You probably want to create an authorisation file that is included in each page where you want to check whether a user is logged in - or as a function.

Within this authorisation page/function you simply need to check a set variable (SESSION or other) whether user has been logged in or not.