I have a problem!
When I try the code below the picture is shown as binary. The script puts a logo down in the right corner of a picture. The script works by itself...
I also get the "Warning: Cannot modify header information - headers already sent by ..." when I use <html><head> etc...
I have to have this picture down in the page in a table...
Anyone? thanks!
<?php
$sql = "select dato,navn,path,undertekst,bruker from bilder where id='$id'";
$result = mysql_query ($sql,$conn);
if (!$result = mysql_query($sql)) { die("En feil har oppstått: ".$mysql_error."<BR>\n"); }
while($myrow = mysql_fetch_row($result)) {
$dato = $myrow[0];
$navn = $myrow[1];
$path = $myrow[2];
$undertekst = $myrow[3];
$bruker = $myrow[4];
print "<center><table width=30% border=0 cellspacing=1 cellpadding=0 bgcolor='$bgcolor1'>";
print "<tr bgcolor='$tableback1'><td>";
//here's the prob
$hovedfil = $path . $navn;
$size1=getimagesize($hovedfil);
$width1=$size1[0];
$height1=$size1[1];
$size2=getimagesize("logo.png");
$width2=$size2[0];
$height2=$size2[1];
$startlogo_x = $width1 - $width2;
$startlogo_y = $height1 - $height2;
header("Content-type: image/jpeg");
$im1 = imagecreatefromjpeg($hovedfil);
imagealphablending($im1, true); // this has to be before imagecopy();
$im2 = imagecreatefrompng("logo.png");
imagecopy($im1,$im2,$startlogo_x,$startlogo_y,0,0,$width2,$height2);
imagejpeg($im1,'',90);
imagedestroy($im1);
imagedestroy($im2);
// stop prob.
"</td></tr>";
print "<tr bgcolor='$tableback2'><td><i><b>$undertekst</b></i><br>Lagt inn av $bruker.</td></tr>";
print "</table>";
print "</center>";
?>



