<?php

$email='progwhiz@yahoo.com';
$pass=rawurlencode('gJ7#mA5!'); // provided upon receipt of payment
$content='Test API'; // The information or link to store in the QR Code
$magnify=0.8; // range from 0.1 to 1 scale
$filename='Testapi'; // the prefix of the name of the QR File
$qrcolor1='FFFFFF';
$qrcolor2='000000'; 
$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
$contrastoffset=0;
$cleanspace='0';// 1 - clear background, 0 - use QR background
$greyscale=0;//1 change to greyscale 


$url = 'https://www.progwhiz.com/qrgenerator/qrcreatepost.php';
$data = ["email" => $email,"pass" => $pass,"content" => $content,"magnify" => $magnify,"filename" => $filename,"qrcolor1" => $qrcolor1,"qrcolor2" => $qrcolor2,"ltrans" => $ltrans,"pichold" => $pichold,"logopath" => $logopath,"contrastoffset" => $contrastoffset, "cleanspace" => $cleanspace, "greyscale" => $greyscale];

$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 => $post,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/x-www-form-urlencoded"]
]);

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

$response=json_decode(base64_decode($result),true);
echo 'URL to QR Code Image : '.$response['response'];
echo '<br>';
echo 'Current Sessions Remaining : '.$response['currentsessions'];
echo '<br>';
echo 'Subscription Exoires on : '.$response['expiry'];
echo '<br>';

?>