Re: Header / Image (gdlib) Problem

From: Date: Fri, 08 Sep 2000 04:31:13 +0000
Subject: Re: Header / Image (gdlib) Problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-15823@lists.php.net to get a copy of this message
On Fri, 08 Sep 2000, Bryan Forstner wrote: > Hello everyone, > > I have a small problem with the header function. I found some > scripting to use as an example to produce dynamic graphics on a page. The > programming is working great, except I can't seem to get anything else to > load into the browser. > > After I send the header command (as shown below), none of the > other HTML code is being passed to the browser. How do I set up the image > file and send that graphic to the middle of the HTML code? > > ----------- > <?PHP > Header("Content-type: image/gif"); > > $graphic = "./graphics/header/logo.gif"; > $img_info = getimagesize($graphic); > > $img = imagecreatefromgif($graphic); > $blue = ImageColorAllocate($img, 0, 0, 128); > $black = ImageColorAllocate($img, 0, 0, 0); > $shadow = ImageColorAllocate($img, 255, 128, 0); > $white = ImageColorAllocate($img, 255,255,255); > // ImageFill($img, 1, 1, $white); > > $logo1 = ImageTTFText($img, 28, 0, 97, 47, $white, "./font/SCRIPTBL.TTF", > "Welcome to Your new Web site"); > $logo2 = ImageTTFText($img, 28, 0, 95, 45, $blue, "./font/SCRIPTBL.TTF", > "Welcome to Your new Web site"); > > imagegif($img); > ImageDestroy($img); > ?> > > <html> > <head> > <title>page title</title> > ... > ----------- > > Bryan You need to make a script that just creates the image - the PHP part of the above script looks right at a glance. Save that as whatever.php and then call it from within your normal page as <IMG SRC="whatever.php"> -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#15823) next »