PHP

Authenticate a license from PHP

Send an HTTPS POST request with JSON using cURL.

PHP
<?php
$payload = json_encode([
  'app' => 'YOUR_APP_NAME',
  'owner_id' => 'YOUR_OWNER_ID',
  'version' => '1.0',
  'license' => $licenseKey,
  'hwid' => $deviceHwid
]);
$ch = curl_init('https://YOUR-DOMAIN/api/v1/license');
curl_setopt_array($ch, [
  CURLOPT_POST => true,
  CURLOPT_POSTFIELDS => $payload,
  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
  CURLOPT_RETURNTRANSFER => true
]);
$result = curl_exec($ch);
curl_close($ch);

Keep server secrets on the server and treat license API responses as untrusted input until parsed and validated.