• Log in or sign up for an account here: https://www.sythe.org/login

Need Html Help!

Visual Basic Matt

Apprentice
Joined
Jan 29, 2008
Sythe Gold
56
Messages
647
Location
Evurar
I don't know much about html but I need to put before someone accesses my site, a "Terms of Service". I need it to be one of them were you press I agree and then when you visit the web page next time it wont show up and will just bring you to the homepage. All help greatly appreciated. Thanks.
 
Typically, you need to use PHP and cookies. And when the user clears his/her cookies, it will be back. Depending on the way you set your site up, the setup might be different but hopefully you can adapt it to your web sites environment.

On your main page (the page with content), have this code at the header before anything and extend it the end.

PHP:
<?php
if (isset($_COOKIE['agree'])){
  require ("index.html");
}
else {
  require ("tos.html");
}
?>

On your tos page, have the information the user needs to accept then build a form with a 'agree' or decline (redirect) button. or just the tick box and 'agree' button, whatever you like. Have it POST the information to the index.html page.

At the top of the index page, above the script we used above, have something like this:

PHP:
<?php
if(isset($_POST['agree'])){
  setcookie("agree", "1", time()+60*60*24*365);
}
?>

It goes something like that.. I may be a bit off or there may be a better way to do it but that's how I would tackle the situation..
 
Next time you see me on MSN message me and I'll modify a script I've already made that allows you to track which IPs have already visited your site.
 
Runescape Gamblingrunescape gambling
Back
Top