<?php

$email='progwhiz@yahoo.com';
$pass=rawurlencode('gJ7#mA5!'); // provided upon receipt of payment
$magnify=0.8; // range from 0.1 to 1 scale
$qrpath='https://www.progwhiz.com/qrimages/pwiz1.png'; // the prefix of the name of the QR File
$ltrans='1'; // 0-opaque , 1 to 6 -translucent logo
$pichold=0.4;// 0.1 to 0.9
$logopath='https://www.progwhiz.com/qrimages/pwiz2.png';// location of the logo to embed, if left blank no logo will be placed
$cleanspace='0';// 1 - clear background, 0 - use QR background
$spacolour='FFFFFF';//Background Colour in RGB Hex
$greyscale=0;//1 change to greyscale 


$url = 'https://www.progwhiz.com/qrgenerator/qrlogocreatepostjson.php';//Generate the QR File with new Logo Embedded and return the path to the QR File in PNG format
$data = array('email' => $email,'pass' => $pass,'magnify' => $magnify,'qrpath' => $qrpath,'ltrans' => $ltrans,'pichold' => $pichold,'logopath' => $logopath, 'cleanspace' => $cleanspace, 'spacecolour' => $spacecolour, 'greyscale' => $greyscale);

$postjson=base64_encode(json_encode($data));

$datajson = array('data_arr' => $postjson);
$datajsonstr=json_encode($datajson);
$post=http_build_query($datajson);
//$post=http_build_query($data);
set_time_limit(0);
$ch = curl_init();
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $url,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_TIMEOUT => 1000000,
    CURLOPT_POSTFIELDS => $datajsonstr,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json', 'Content-Length: ' . strlen($datajsonstr)]
]);

$result = curl_exec($ch);
curl_close($ch);

$response=json_decode(base64_decode($result),true);
echo $response['response'];

?>