Age prompt for website

Discussion in 'HTML & Website Design' started by Chumm, Jan 6, 2012.

  1. #1
    Basically I want anyone who goes to my website confirm they're over 18 with a simple yes or no button.
    How can I do this?
     
    Chumm, Jan 6, 2012 IP
  2. thewoodcutter

    thewoodcutter Active Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    56
    #2
    <script type="text/javascript">
    var agev = document.cookie;
    if(agev!='age=1'){
    if(confirm("Are you above 18 years?")) setCo(); else window.location.href = "http://yoursite.com/notallowed.htm";
    function setCo(){
    document.cookie = 'age=1; path=/'
    }
    </script>


    Try this, might contain syntax errors, did not test it. and change yoursite.com to ur domain
     
    thewoodcutter, Jan 6, 2012 IP