
                                                <?php
       include '../includes/connection.php';
if (isset($_GET['key1'])) {
                                            
                                                                             
$key1=$_GET['key1'];
$key2=$_GET['key2'];
$bid= $_GET['bid']; 
$serial= md5($_GET['serial']); 
$now = time();

$checkdate="SELECT * FROM zhizhao where business_id='$bid'";
$check=mysqli_query($conn,$checkdate) or die("ERROR : " . mysqli_error($conn));
if (mysqli_num_rows($check)==0) {
  $activate=mysqli_query($conn,"INSERT into zhizhao(Kaishi,Jieshu,business_id,disquedur) Values('$key1','$key2','$bid','$serial')");
}else{

$activate=mysqli_query($conn,"UPDATE zhizhao SET Kaishi='$key1',Jieshu='$key2',disquedur='$serial' where business_id='$bid'");
}
if ($activate)
{
?>

<meta http-equiv="refresh" content="0;URL='../index.php'" />
   <?php
}
else{
echo "Data failed to insert: ".mysqli_error($conn);
}

  } 
?>