<?php ob_start(); ?>
<?php include("conn.php");?>
<?php include("common/head.php")?>
<?php 



if(isset($_GET['email'])){
    $email=$_GET['email'];
$status=1;
$sql = "SELECT `id` FROM `users` WHERE `email`='".$email."'";
$result = mysqli_query($conn,$sql)or die( mysqli_error($conn));
$row=mysqli_fetch_array($result);
$id=$row['id'];
$date=date("F j, Y ");
$by=$id_user;



$sql = "INSERT INTO `user_role`(`userid`, `date`,`by`) VALUES ('$id','$date','$by')";
if(mysqli_query($conn,$sql)){

echo"<script> window.location.href='user'</script>";
}
else{
  echo 'Error: '.mysqli_error($conn);
}

	}

 ?>