I have an issue with outputting a GD-script to a file on the server
My script:
Code: Select all
<?
include_once("inc/ *******.php");
header ("Content-type: image/jpeg");
$result = mysql_query("SELECT * FROM ******WHERE zid = '".$_GET['zid']."'");
$background = imagecreatefromgif("img/bakgrund.gif");
$i=0;
while ($s = mysql_fetch_array($result, MYSQL_ASSOC))
{
if ((!($i%32)) && ($i))
{
$hojd++;
$j=0;
}
$insert = imagecreatefromgif("img/map/". $s['img_url'].".gif");
imagecopymerge($background,$insert,($j*16),($hojd*16),0,0,16,16,100);
$j++;
$i++;
}
$filnamn = $_GET['zid'].".jpg";
imagejpeg($background, $filnamn, 100);
imagedestroy($background);
imagedestroy($insert);
?>It's supposed to generate an image named after the zid specified. For example "1.jpg", "2.jpg" and so on. One at a time ofc.
Code: Select all
imagejpeg($background, $filnamn,100);