Homepage with Cookies

Go down

Homepage with Cookies

Post by Jut0z on June 16th 2010, 1:16 am

Hey, I was wondering if it's possible with phpBB2 to make a Homepage, that if you've never visited that takes you to a Terms of Service page, which you have to accept before you can enter the website, then upon your next visit cookies that are enabled will tell the site you've accepted and it re-routes you to the normal homepage instead of the terms of service.

New Member

Posts : 8
Reputation : 0
Language : English

Back to top Go down

Re: Homepage with Cookies

Post by rblatch on June 16th 2010, 1:22 am


// page to go to if cookie exists

// number of days cookie lives for
num_days = 60;
function ged(noDays){
    var today = new Date();
    var expr = new Date(today.getTime() + noDays*24*60*60*1000);
    return  expr.toGMTString();

function readCookie(cookieName){
    var start = document·cookie.indexOf(cookieName);
    if (start == -1){
        document·cookie = "seenit=yes; expires=" + ged(num_days);
    } else {
        window.location = go_to;

// -->

Paste this at the top of the HTML page of you TOS Smile
Active Poster

Male Posts : 1042
Reputation : 2
Language : HTML &amp;amp; CSS (Learning)
Location : Graphics Central

Back to top Go down

Back to top

Permissions in this forum:
You cannot reply to topics in this forum