Trying to make script which uploading image on imgur anonymously. Just blank page when I run it. I need to post image(in base 64 string format) with title and description. Sorry for my english and code.
<?
header ("Content-type: image/png");
$im = ImageCreate (200, 100);
$couleur_fond = ImageColorAllocate ($im, 255, 0, 0);
$client_id="d9514d92012b55a";
$pvars = base64_encode($im);
$timeout = 30;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.imgur.com/3/image.json');
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Client-ID ' . $client_id . ', title: title, description: description'));
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars);
$out = curl_exec($curl);
curl_close ($curl);
$pms = json_decode($out,true);
$url=$pms['data']['link'];
?>