<?
$password = substr(md5(microtime()) , rand(0, 26) , 8);
$username = 'SAG' . $password;
$params = ['username' => $username, 'mobile' => 'yes', 'lang' => 'en', 'game_code' => 'lobby', 'page_site' => 'live'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.gmaster8.com/BBIN/game/open",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
"Authorization: Basic U0FHQVBJOjEyMzRxd2Vy"
) ,
CURLOPT_USERPWD => "$username:$password",
));
$result = curl_exec($curl);
echo $result;
?>
I got the $result like this:
{"url":"https:\/\/888.gsoftbb.com\/app\/WebService\/JSON\/display.php\/Login?website=gamingsoft&uppername=dgmaster8rmb&username=C71SAGabfbbcc9&lang=en-us&page_site=live&page_present=live&key=t7ksrtefa9e54610003dfb2b05986de7fcfa6btsmtpho&"}
How can I post the API and then load the url in response from API server? What code should I replace the line
echo $result;
to load the url in json response from API server?