Need Html Help!

Discussion in 'Web Programming' started by Visual Basic Matt, Nov 6, 2008.

Need Html Help!
  1. Unread #1 - Nov 6, 2008 at 2:18 PM
  2. Visual Basic Matt
    Joined:
    Jan 29, 2008
    Posts:
    647
    Referrals:
    2
    Sythe Gold:
    56
    Discord Unique ID:
    223154494878253056

    Visual Basic Matt Apprentice

    Need Html Help!

    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.
     
  3. Unread #2 - Nov 7, 2008 at 10:27 PM
  4. WildDisease
    Referrals:
    0

    WildDisease Guest

    Need Html Help!

    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..
     
  5. Unread #3 - Nov 8, 2008 at 12:03 AM
  6. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Need Html Help!

    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.
     
< Hiring For a new massive runescape help site!!! NO PROFFESIONALS! | Zebulon: New Web Language >

Users viewing this thread
1 guest


 
 
Adblock breaks this site