You are here: Re: Image basics « PHP Programming Language « IT news, forums, messages
Re: Image basics

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация