PHP Integration

Please note these are examples. It is recommended that you make one that is more complex and adjustable to your needs.

Dependencies

Make sure cURL is installed on your server - The cURL library may not be installed on your server by default. You can check if it's installed by running the command curl --version in your terminal. If it's not installed, you can install it using your server's package manager.

Example PHP

Copy

<?php
function checkLicense($key, $software, $version) {
    $secret = 'PUT_YOUR_SECRET_KEY';
    $type = 'license';
    $url = "https://<YOUR_DOMAIN>/api.php?secret={$secret}&type={$type}&key={$key}&product={$software}&version={$version}";
    
    $response = file_get_contents($url);
    
    if ($response === false) {
        echo "Error...";
        exit;
    }
    
    $data = json_decode($response, true);
    
    if ($data['valid']) {
        echo "Success!";
    } else {
        echo "Incorrect.";
    }
}
?>

You can then call the checkLicense function with the appropiate parameters to check the license status of a product:

Copy

$result = checkLicense('LICENSE_KEY', 'PRODUCT_NAME', 'VERSION_NUMBER');

if ($result !== false) {
    // Handle successful license check
} else {
    // Handle failed license check
}

Last updated