Check if user is logged on

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wiiboy
Forum Newbie
Posts: 2
Joined: Sun Oct 19, 2008 10:16 pm

Check if user is logged on

Post 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?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Check if user is logged on

Post 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.
wiiboy
Forum Newbie
Posts: 2
Joined: Sun Oct 19, 2008 10:16 pm

Re: Check if user is logged on

Post 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:
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Check if user is logged on

Post 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.
Post Reply