Log in

View Full Version : Outside of Forums Check for Forum Cookie


Jako
07-29-2005, 12:40 AM
I have my site at mydomain.com and my forums at mydomain.com/forums

I want the information at mydomain.com to be only viewable to the people that are logged in. What cookie should I check for and include on every page to see if the user is logged in or not?

Tony G
07-29-2005, 01:34 AM
Is this mydomain.com a portal page or just a regular html/php/whatever page?

Jako
07-29-2005, 03:20 AM
It's just a regular php page.

Any help would be greatly appreciated.

Jako
07-30-2005, 06:31 AM
Does anyone have any ideas? I got most of it right I think, but I want your input.

romerom
07-30-2005, 06:02 PM
try this..

chdir("./forum/");
include_once('./global.php');
chdir("../");

if ( !$bbuserinfo['userid'] ) {
print "you gets no love";
} else {
print "content content content!!!"
}

harry1951
07-31-2005, 08:40 AM
I need this too but also a check if the user is a member. What do I have to add?

Jako
07-31-2005, 08:41 AM
Harry, I have been working on this for a while tonight, it's already going on 6am over here. I'm off to bed, but I got it to work finally, I will post the code in the morning.

harry1951
07-31-2005, 08:56 PM
I will be patient :-)

romerom
08-01-2005, 12:08 AM
I need this too but also a check if the user is a member. What do I have to add?

did that code snippet i posted up work? you'll obviously have to modify it to fit your use