| 
 Posted by NC on 12/19/05 01:23 
swisscheese wrote: 
> 
> After reading 5 tutorials, I must be missing something basic. 
 
The key is to realize that you are going to need TWO scripts: 
 
1. The script (or even a static HTML file) containing the image 
   tag.  Example: <IMG SRC="image.php"> 
 
2. The PHP script posing as image.  Be sure that there are no 
   symbols in the script file before the first "<?" or "<?php". 
 
   This will ensure that the browser will render the output of 
   the script as an image. 
 
> Also I don't really want to create the file - just output the image 
> directly. 
 
You don't have to if you don't want to...  In the first script (or an 
HTML file) you write: 
 
<IMG SRC="image.php"> 
 
In the image.php, you write: 
 
header("Content-type: image/png"); 
// Here's where you actually draw the image... 
imagepng($im); 
imagedestroy($im); 
 
Cheers,  
NC
 
  
Navigation:
[Reply to this message] 
 |