if(isset($_POST['checkage'])) { $day = ctype_digit($_POST['day']) ? $_POST['day'] : ''; $month = ctype_digit($_POST['month']) ? $_POST['month'] : ''; $year = ctype_digit($_POST['year']) ? $_POST['year'] : ''; #echo $day." ".$month." ".$year; $birthstamp = mktime(0, 0, 0, $month, $day, $year); $diff = time() - $birthstamp; $age_years = floor($diff / 31556926); if($age_years >= 21) { # setcookie('legal', 'yes', 0, '/', '.'.$_SERVER['SERVER_NAME']); # cookie expires when the browser closes /* setcookie('legal', 'yes', time() + 31556926, '/', '.'.$_SERVER['SERVER_NAME']);*/ # The above line sets a cookie called "legal" throughout the entire domain and its value is yes. The cookie will expire next year, if it is not manually deleted. $url = 'http://www.lagerlessonslive.com/denver/LL_web/'; } else { # setcookie('legal', 'no',0, '/', '.'.$_SERVER['SERVER_NAME']); # cookie expires when the browser closes # setcookie('legal', 'no', time() + 31556926, '/', '.'.$_SERVER['SERVER_NAME']); # You're not old enough, come back next year! $url = 'http://www.worldsofdiscovery.com/'; } header ('Location: ' .$url); } ?>

