lundi 25 avril 2016

Age Verify code kicking people out of to old?

my code is letting people in if there above 19 but also if your to old its not letting you enter why is this ? I had a person try to enter my site today with 1958 and got kicked out yet i can enter 1989 and it works fine

index page

<!doctype html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="">
<!--<![endif]-->

<head>
<meta charset="utf-8">
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>510 Vapour</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/responsive.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="http://ift.tt/1gxGs2S">
</head>
<div class="js">
<body>
  <!-- Preloader section -->
<div id="preloader"></div>
 <!-- Preloader section -->
<div class="container"> 
  <!-- AccessBox section -->
  <div id="accessbox"class="animated bounceInDown"> <img class="profile-img" src="images/logo.png" />
    <h2 class="text-center">Please enter your date of birth</h2>
    <!-- Form section-->
    <form action="php/access.php" method="post" class="access-form">
      <input type="text" name="yy" class="access-input-lg" placeholder="2016" required autofocus>
      <input type="text" name="mm" class="access-input" placeholder="05">
      <input type="text" name="dd" class="access-input" placeholder="10">
      <input type="submit" name="submit"class="access-btn" value="OK" >
      <div id="remember" class="checkbox text-center">
        <label class="text-center">
          <input type="checkbox" value="remember-me">
          Remember me </label>
      </div>
    </form>
    <!-- Form section-->
    <h1 class="text-center"><i class="fa fa-exclamation-triangle red"></i> You must be 19+ to enter this site </h1>
    <p class="text-center">By ENTERING, you are consenting to your Province's Smoking Laws. You may be required to show a valid government issued Photo ID indicating your date of birth at time of delivery or at the Post Office.</p>
  </div>
  <!-- AccessBox section --> 
</div>
<!-- /container --> 
<!-- JS files--> 
<script src="http://ift.tt/1LdO4RA"></script> 
<script src="js/bootstrap.min.js"></script> 
<!-- Pre Loader--> 
<script type="text/javascript">
jQuery(document).ready(function($) {  

$(window).load(function(){
    $('#preloader').fadeOut('slow',function(){$(this).remove();});
});

});
</script>
</body>
</div>
</html>

access.php

<?php

    $minAge = 19;

    if(isset($_POST['submit'])){

        if(strlen($_POST['mm'])==1)
        $month = '0'.$_POST['mm'];
        else 
        $month = $_POST['mm'];
        $agevar = $_POST['yy'];

      $age = strtotime($agevar);

      $nineteen = strtotime("-" . $minAge . " years");

      if($age && $nineteen && $age <= $nineteen){

         header('Location: http://ift.tt/1QxDDIE');

      }

      else{

        header('Location: ../error.html');

      }

    }

    ?>

Aucun commentaire:

Enregistrer un commentaire