Re: creating gifs
| From: | Glenn Little | Date: | Mon, 04 Sep 2000 21:21:53 +0000 |
| Subject: | Re: creating gifs | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2609@lists.php.net to get a copy of this message | ||
You can only use the header() call when it is at the very beginning
of a page. You can't even have whitespace in any html before
the header.
I haven't done inline gifs like that yet, but I think you'd need
to do it with an extra step: generate the image to an output
file, then call that output file from your html.
A rough guess:
(hola.html)
<html><head></head>
<body bgcolor=black>
<?php generate_image.php?hola&./filename ?> <!-- or just make it a function -->
<img src="./filename">
</body></html>
> From: "marco eyzaguirre" <meyzagui@ilender.com.pe>
>
> hi, this is my rutin for gif create:
>
> (imagen.php)
>
> <?php=20
> Header("Content-type: image/gif");
> $string=3Dimplode($argv," ");
> $im =3D imagecreatefromgif("images/ban.gif");
> $orange =3D ImageColorAllocate($im, 220, 210, 60);
> $px =3D (imagesx($im)-7.5*strlen($string))/2;
> ImageString($im,3,$px,9,"hola",$orange);
> ImageGif($im);
> ImageDestroy($im);
> ?>
>
> and this is call from:
>
> (hola.html)
>
> <html><head></head>
> <body bgcolor=3Dblack>
> <img src=3D"imagen.php?hola">
> </body></html>
>
> nothing appears when i call hola.html but this appears when i exe =
> image.php:
>
> Warning: Cannot add header information - headers already sent by (output =
> started at /home/httpd/html/marco/imagen/imagen.php:2) in =
> /home/httpd/html/marco/imagen/imagen.php on line 3
> GIF87a=C8?=E6=FE=FD=FF=D4=F5=F2=D3=E4=D0=EF=EE=BF=DB=E6=AE=F4=EB=A4=F7=CB=
> =A7=DB=C5=A9=E5=C7=C9=FD=C8=C7=F9=D1=DC=F4=AB=C5=F9=A9=A9=DF=A9=B0=EA-=A8=
> =EDYO=D9=A8Z=C1 =
> s=B9=A5p=B5=BFr-=BBvsTno=9Dm???z=A4=A2o=CC=A6=BC=C9=A8=C0=C0=C0=C0=DC=C0=C1=
> =E1=AA=A9=E0=D6=DD=EC?=E2=CD"=DE=CDf=E5=EBf=F4=F4,=B9=DAr=B8=D3A=DF=C97=E6=
> =E7=3D=D5=D5 =F1=E7 =
> =E2=C0=02=DB=B0=18=D3=AB=02=E1=8F=01=C3=8D=BBw=A6|=B1_S^=01?xmjXuj|=1AD"=1E=
> :S=01>e=02AJ=3D4)+=08D=14=03( =
> =0E&=14]?GZ%dN?T=18=8F6=B2=3Dk=1AsWG=8D~(.s&e>+bY?=AD=A9=B7=B4=B0=15=BE=C5=
> =B9=D1=17=B7=AA>=DE=A56=DD=A4X=E2<]=E3=A2o=C0fm=DDod=E0z=8F=BB.D=B9?'=DC?=
>
> '=DEn=F7=F7=E7=DC=D2<,=C8?@=07=FF?_,f".??^?S<O=8DZ=8F=90''"".-=8D3D1Y.)/0=
> /0..=0Ff"....,,, =
> "=19?.,,Z?_,f".,=04(=06=05[=05=05=05=03=05!=04D?_,f".??^?S<O=8DZ=8Ff.....=
> ........................ etc,etc
>
> Why is that?, can anybody helpme?
> (I use Apache/1.3.12 PHP Version 4.0.1pl2)
>
>
> marco eyzaguirre
> lima - peru
>
>
> ------=_NextPart_000_0010_01C01685.11A596A0--
>