Click to See Complete Forum and Search --> : Date of Birth / Age Checker Authentication


FoxyWFU
June 5th, 2005, 07:29 PM
I am creating a website for a local distillery and they want a landing page were the visitors have to enter their date of birth, so that only people over 21 can view the actual website. Check out http://www.busch.com for an example. I've searched around and can't really find anything. I know some Java, but not enough to implement something like this. Any ideas or help would be greatly appreciated.

cjard
June 7th, 2005, 04:42 AM
this is something you could do in javascript.. how secure do you want to be?

FoxyWFU
June 7th, 2005, 10:54 PM
I don't think that it has to be too secure. All I need it to do is go to the actual homepage if they put in a birthday that is over 21 or go to some other site such as Google.com if they put in a birthday that is under 21. I believe that the necessity of this is all technicalities. Any help would be greatly appreciated.

FoxyWFU
June 13th, 2005, 03:58 PM
I'm not sure if the way I worded the question is confusing, since I haven't really gotten any responses as of yet. I need some sort of program that won't allow a web visitor to get from the initial "landing" page to the actual homepage (which has the content on it) unless they enter a valid date of birth which would make them of legal drinking age (21 years old). This does not have to be very secure. I'm not sure how else to explain it. If you go to any liquor/beer website, you can see examples of what I need to do. Any help is greatly appreciated.

FoxyWFU
June 15th, 2005, 11:29 PM
So I attempted to write some code for this and I think I almost have it. I put it into the HTML, when I tested it (by inputting a birthday and click "submit") nothing happens. Here is all of the HTML:

====================================

<html>
<head>

<script language="javascript">

function start() {
document.form1.bday.value = "";
document.form1.bmonth.value = "";
document.form1.byear.value = "";
}

function run() {

<!-- Begin "Today's Date" -->

Stamp = new Date();
var year = Stamp.getYear();
var month = Stamp.getMonth();
var day = Stamp.getDate();

<!-- End "Today's Date" -->


<!-- Begin "Check Age" -->

if ((year - byear) > 21)
window.location = "home.html";
else if ((year - byear) < 21)
window.location = "http://www.google.com";
else {
if ((month - bmonth) > 0)
window.location = "home.html";
else if ((month - bmonth) < 0)
window.location = "http://www.google.com";
else {
if ((day - bday)) >= 0)
window.location = "home.html";
else
window.location = "http://www.google.com";
}
}

<!-- End "Check Age" -->

}
</script>

</head>

<body onLoad="start()">

<form name=form1>
Month<INPUT name=bmonth size=3> *
Date<INPUT name=bday size=3>*
Year<INPUT name=byear size=6> *
<INPUT name=start onclick=run() type=button value="Submit">
</form>

</body>
</html>

====================================

ANY IDEAS?