| 
    <?php
session_start();
 require_once('./config.php');
 require_once('usefullfunctions.php');
 $url='testaccess.php';
 if(isset($_SESSION ['groupstatut'])&&isset($_SESSION["startaccesstime"])&&isset($_SESSION["endaccesstime"])&&$_SESSION ['groupstatut']==true&&inrangetime(explode(':',date('H:I:s')),explode(':',$_SESSION["startaccesstime"]),explode(':',$_SESSION["endaccesstime"]))){
 echo '<script type="text/javascript">window.location="'.$url.'";</script>';
 exit;
 }
 ?>
 <!DOCTYPE>
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <title>VALIDATION</title>
 
 <style type="text/css">
 
 #other {
 font-family: verdana;
 font-weight: bold;
 font-size: 14px;
 font-style:italic;
 color: #FFFFFF;
 background-color: grey;
 width: auto;
 margin-left: 15%;
 margin-right: 15%;
 padding:2%;
 }
 
 label
 {
 display: block ;
 width: 150px;
 float : left ;
 }
 </style>
 
 </head>
 <body>
 <div id="other">
 <div>
 <?php
 if(isset($_GET['id'])&&!empty($_GET['id'])){
 $query=$bdd->prepare('SELECT user_id FROM users WHERE idvalidation=:id');//get the id
 $query->bindValue(':id',$_GET['id'],PDO::PARAM_STR);
 $query->execute();
 $id=$query->fetch();
 $query->CloseCursor();
 if(!empty($id)){
 $req=$bdd->prepare('UPDATE users SET statutvalidation=:statutvalidation WHERE user_id=:id');
 $req->execute(array('statutvalidation'=>1,'id'=>$id['user_id']));
 $req->CloseCursor();
 echo'You have now completed your registration.Please go to connexion page to access the members area';
 }else{
 echo'You have not yet registrated please go to registration form to sign up ';
 }
 }else{
 echo'You have not yet registrated please go to registration form to sign up ';
 }
 ?></div>
 </body>
 </html>
 |