Homepage with Cookies
2 posters
Page 1 of 1
Homepage with Cookies
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.
Jut0z- New Member
- Posts : 8
Reputation : 0
Language : English
Re: Homepage with Cookies
- Code:
<script>
// page to go to if cookie exists
go_to = "RE-DIRECTION URL";
// 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;
}
}
readCookie("seenit");
// -->
</script>
Paste this at the top of the HTML page of you TOS
rblatch- Active Poster
- Posts : 1042
Reputation : 2
Language : HTML &amp; CSS (Learning)
Location : Graphics Central
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum