0
나는이 whmcs 내부 api 자신의 URL에서 ID 배열을 듣고 felexible 싶어요. (예 : www.example.com/api.php?pid=2). 어떤 도움을 주시겠습니까?API를 유연하게 사용하여 자체 URL에서 변수를 수신하는 방법은 무엇입니까?
<?php
require_once('init.php');
$command = 'GetProducts';
$postData = array(
'id' => '1',
);
$adminUsername = 'admin';
$results = localAPI($command, $postData, $adminUsername);
print_r($results);
아래 코드를 사용했지만 성공하지 못했습니다.
<?php
require_once('init.php');
$command = 'GetProducts';
$prid = $_GET["pid"];
$postData = array(
'id' => '.'echo $prid;'.',
);
$adminUsername = 'admin';
$results = localAPI($command, $postData, $adminUsername);
print_r($results);