I’m using this php code in image.php file to merge a png image with text from facebook.
Can someone please help me to download this image from image.php to my server. I have tried alot of coding but failed.
code for image.php is:
<?php
header("Content-Type: image/png");
include_once 'facebook.php';
include_once 'config.php'; //contains app id and secret key for fb app
include_once 'token.php'; // contains access token and initiates a valid session
$facebook = new Facebook(array(
'appId' => FACEBOOK_APP_ID,
'secret' => FACEBOOK_SECRET_KEY,
));
$me = $facebook->api('/me');
$im = ImageCreateFrompng("certificate.png");
$black = ImageColorAllocate($im, 0, 0, 0);
$start_x = 35;
$start_y = 230;
Imagettftext($im, 20, 0, $start_x, $start_y, $black, 'ambient.ttf', $me['name']);
Imagejpeg($im, '', 100);
ImageDestroy($im);
?>
Can someone please help me to download this image from image.php to my server. I have tried alot of coding but failed.
To save image in your server:
replace:
Imagejpeg($im, '', 100);with this:
Imagejpeg($im, '/path/to/your/dir/image.jpg', 100);