Created
December 2, 2010 21:26
-
-
Save deserat/726102 to your computer and use it in GitHub Desktop.
agegate code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("div#submit").click( function(e) { | |
var today = new Date(); | |
var now = today.getTime(); | |
var age_limit = now - 410240038000; | |
var y = ( !isNaN(parseInt( $('#year_field').val() )) ) ? parseInt( $('#year_field').val() ) : 2010; | |
var m = ( !isNaN(parseInt( $('#month_field').val() )) ) ? parseInt( $('#month_field').val() ) -1 : 0 ; | |
var d = ( !isNaN(parseInt( $('#day_field').val() )) ) ? parseInt( $('#day_field').val() ) : 0; | |
var adate = new Date(y,m,d); | |
if( age_limit < adate.getTime() ) { | |
$.cookie("agegate_fail", "1", { expires: 1 }); | |
$("#agegate_form").fadeOut('600', function() {$("#agegate_fail").fadeIn()}); | |
} else { | |
$.cookie("agegate", "1"); | |
var path = ("<?= $e->path ?>" != "" && "<?= $e->path ?>" != "/")? "/<?= $e->path ?>.html" : "<?= APP_URL ?>"; | |
window.location.reload(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
oh and for blocking them from reentering