Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 11:24 pm EST
Geeklog Forums
disclaimer/age-check?
I'm creating a site (with Geeklog) that's going to cater to a slightly evil clientele. Therefore, I'd like to avoid future hassles by requiring people to click a "I am blah blah years old and have no problem with the potential evil and offensive content blah blah blah" link on the way into the site.
I don't want to restrict anonymous viewers, just make them agree to the simple disclaimer. But I want to be sure that they've seen the disclaimer, so I'd like to set a cookie or something when it's clicked. I've done this with Perl in the past, so I imagine it couldn't be too hard with PHP.
My question is about how to be sure a person can't sneak in a back door... is there a template that gets loaded on every geeklog page, that I can throw a cookie check into, that will redirect them to the disclaimer page, if the cookie doesn't exist?
Any other suggestions or advice on how to write such a cookie-check/redirect in PHP?
I don't want to restrict anonymous viewers, just make them agree to the simple disclaimer. But I want to be sure that they've seen the disclaimer, so I'd like to set a cookie or something when it's clicked. I've done this with Perl in the past, so I imagine it couldn't be too hard with PHP.
My question is about how to be sure a person can't sneak in a back door... is there a template that gets loaded on every geeklog page, that I can throw a cookie check into, that will redirect them to the disclaimer page, if the cookie doesn't exist?
Any other suggestions or advice on how to write such a cookie-check/redirect in PHP?
9
7
Quote
Status: offline
efdisaster
Forum User
Newbie
Registered: 05/21/04
Posts: 4
thanks, I'll start peeking at that template...
any suggestions on writing this check/redirect scheme?
In the past with Perl I'd write a check page, and "yes/agree" would lead to a page that set the cookie and then immediately redirected to the actual content. The page with the content (header.thtml in this case) would see if the cookie existed and redirect out to the check page if it didn't.
My searches of the web have uncovered some possible issues with using header("Location: and the cookie not being set, so I should probably stick to printing meta refreshes, yes?
Is this what I should be doing here, or is there an easier way with Geeklog and/or PHP?
any suggestions on writing this check/redirect scheme?
In the past with Perl I'd write a check page, and "yes/agree" would lead to a page that set the cookie and then immediately redirected to the actual content. The page with the content (header.thtml in this case) would see if the cookie existed and redirect out to the check page if it didn't.
My searches of the web have uncovered some possible issues with using header("Location: and the cookie not being set, so I should probably stick to printing meta refreshes, yes?
Is this what I should be doing here, or is there an easier way with Geeklog and/or PHP?
8
5
Quote
Status: offline
efdisaster
Forum User
Newbie
Registered: 05/21/04
Posts: 4
right, since I went to the trouble of learning how to check for a cookie in PHP, and then realized that the .thtml files aren't PHP at all, I decided to add my check [to see if the user has the cookie set when they agree to enter the site] into lib-common.php. It seemed like that file was being accessed or refernced by every other PHP page.
Was it a good bet? It seems to be working.
It's just one line that checks to see if a cookie exists and redirects to my entrance tunnel if it doesn't. Shouldn't do any harm, right?
Anyway, thanks for looking
Was it a good bet? It seems to be working.
It's just one line that checks to see if a cookie exists and redirects to my entrance tunnel if it doesn't. Shouldn't do any harm, right?
Anyway, thanks for looking
6
7
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can actually use PHP in header.thtml (and only there), but lib-common.php is a good place as well. You only have to remember to apply your patch to lib-common.php again when you upgrade to a new version of Geeklog.
Having said that, maybe adding your code to lib-custom.php (outside of any functions there) would work, too.
bye, Dirk
Having said that, maybe adding your code to lib-custom.php (outside of any functions there) would work, too.
bye, Dirk
6
7
Quote
All times are EST. The time is now 11:24 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content