Hi,
I was wanting to create a "badge" for people to post in forums, websites ect as a means of free advertising for the site.
I created a template and added a listing image and text using GD.
It outputs great, but wont save. Id rather have the file created once and have them link to the gif thats created rather than call a php file everytime. Also some forums ect dont allow script and the image gets rejected.
Heres the code. What do i need to change to actually save the file?
<?php
header("Content-type: image/gif");
//Our variables containing the text to be displayed.
//This will output: Welcome to Gamexe.net
$var1 = "Designer: Siopa Rince";
$var2 = "For Ages: 10-11";
$var3 = "Condition: New";
$var4 = "800 GBP";
$var5 = "SKU: SIOPA21DL5";
//Our font size
$font1 = 3;
$font2 = 8;
//The image the text will be on
$image = "ad-bg.gif";
$im = ImageCreateFromgif("$image");
$photo = "../listing-images/thumbnails/other_19_60x60.jpg";
//Text color
$text_color = imagecolorallocate ($im, 0, 0,0);//black text
$text_color2 = imagecolorallocate ($im, 255, 33,66);//black text
$text_color3 = imagecolorallocate ($im, 255, 255,255);//black text
imagestring ($im, $font1, 100, 40, $var1, $text_color);
imagestring ($im, $font1, 100, 55, $var2, $text_color);
imagestring ($im, $font1, 100, 70, $var3, $text_color);
imagestring ($im, $font2, 100, 95, $var4, $text_color2);
imagestring ($im, $font1, 10, 140, $var5, $text_color3);
$overlay = imagecreatefromjpeg($photo);
$swidth = imagesx($im);
$sheight = imagesy($im);
$owidth = imagesx($overlay);
$oheight = imagesy($overlay);
$ad = imagecopy($im, $overlay, 17, 45, 0, 0, $owidth, $oheight);
$im = imagegif ($im);
imagegif($ad,'test.gif',100);
?>
Thanks in advance,
Danny