| Server IP : 104.21.37.246 / Your IP : 172.71.28.146 [ Web Server : Apache System : Linux cpanel01wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.59.el6.x86_64 #1 SMP Thu Dec 6 05:11:00 EST 2018 x86_64 User : cp648411 ( 1354) PHP Version : 7.2.34 Disable Function : NONE Domains : 0 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home2/cp648411/public_html/simded.com/home/ |
Upload File : |
<?php
$curl = curl_init();
$shorten = 'https://xgd.io/V1/shorten?url=';
$originalURL = 'https://horo.simded.com/daily/extra2.php';
$Authentication = '3519a3871b8050ecd67e2c36b8a36066';
//https://xgd.io/V1/shorten?url=https://example.com&key={Your API Key}'
$sentURL = $shorten.$originalURL.'&key='.$Authentication;
curl_setopt_array($curl, array(
CURLOPT_URL => $sentURL,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: 3519a3871b8050ecd67e2c36b8a36066",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$response = json_decode($response, JSON_UNESCAPED_UNICODE );
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response['shorturl'];
print_r($response);
}
?>