<?php

$json = file_get_contents('php://input');
$data = json_decode($json, true);


$key = $data['key'];
$email = $data['email'];


$decodedKey = decryptData($key);


if ($decodedKey == 'bbz091' && strlen($email) > 0) {

 $temp = array(); 

  
    $con = mysqli_connect("localhost", "mlblxrml_user", "9ichm9pV@APdK_D", "mlblxrml_user_detabase");
    
     $sql = "SELECT * FROM qr_userTable WHERE email = '$email'";
      $output = mysqli_query($con, $sql);
      
      
      
       if (mysqli_num_rows($output) > 0) {
        while ($row = mysqli_fetch_assoc($output)) {
            $nid = $row['nid'];
            $email = $row['email'];
            $image = $row['image'];
    
            
         $temp['result'] = 'https://appdevbbz.com/helloworld/' . $row['image'];

           
          
           echo "your qr";

        }
       
     
    }

} 
    

    


}else {
    echo json_encode(["error" => "No user found or email missing"]);
}




function decryptData($text) {
    $decoded = base64_decode($text);
    return openssl_decrypt($decoded, 'AES-128-ECB', 'bbz091***bbz091*', OPENSSL_RAW_DATA);
}

?>