Skip to content

Instantly share code, notes, and snippets.

@stefanpejcic
Created August 19, 2022 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanpejcic/abc0816663bde0598c2abd19d3c1039e to your computer and use it in GitHub Desktop.
Save stefanpejcic/abc0816663bde0598c2abd19d3c1039e to your computer and use it in GitHub Desktop.
WHMCS - get user data from the url
<?php
// include whmcs
require_once $_SERVER['DOCUMENT_ROOT'].'/init.php';
/**
* WHMCS Sample Local API Call
*
* @package WHMCS
* @author WHMCS Limited <development@whmcs.com>
* @copyright Copyright (c) WHMCS Limited 2005-2016
* @license http://www.whmcs.com/license/ WHMCS Eula
* @version $Id$
* @link http://www.whmcs.com/
*/
// get url and parse client ID string from the url
$url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
parse_str(parse_url($url)['query'], $params);
$command = 'GetClientsDetails';
$postData = array(
'clientid' => $params['clientid'],
'stats' => true,
);
$results = localAPI($command, $postData);
print '<pre>';
print_r($results);
print '</pre>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment