Don't worry I am not in a hurry 🙂. Just digest and ask the questions you have in mind.
Here is a script with an example of how to use the IMG HTML tag to output a picture:
image.html.php:
<HTML>
<BODY>
<?PHP
echo ("Bonjour mon barre graph!");
?>
<IMG SRC="image.img.php">
Au revoir mon barre graph!
</BODY>
</HTML>
image.img.php:
<?
// echo "Bonjour";
$image = ImageCreate(550,220);
$fond = ImageColorAllocate($image,208,216,213);
$coul_axes = ImageColorAllocate($image,11,62,43);
$coul_lignes = ImageColorAllocate($image,227,235,232);
$coul_legendes = ImageColorAllocate($image,11,62,43);
$coul_barres = ImageColorAllocate($image,42,124,94);
$coul_orange = ImageColorAllocate($image,207,140,53);
// les axes
imageline ($image, 30,30,30,190,$coul_axes);
imageline ($image,30,190,530,190,$coul_axes);
// les flêches au bout des axes
$tab_fleche_ord = array (30,30,26,34,34,34);
$tab_fleche_abs = array (530,190,526,186,526,194);
imagefilledpolygon ($image, $tab_fleche_ord, 3, $coul_axes);
imagefilledpolygon ($image, $tab_fleche_abs, 3, $coul_axes);
// Légendes
imagestring ($image,2,10,10,"Nbr de pages", $coul_legendes);
imagestring ($image,2,515,200,"Heure", $coul_legendes);
// une barre
for ($i=1; $i<=24; $i++) {
//imagestring ($image ,2,18+(20 *$i),190,$i,$coul_legendes);
imagefilledrectangle ($image,($i*20) + 15, 50, ($i*20) + 30,189,$coul_barres);
}
//$im=Imagepng($image);
imagepng($image);
?>
image.html.php is a PHP/HTML file, it has a IMG tag that "calls" the image.img.php file. The image.img.php simply generates a flow chart (sorry for the French words and comments).
It's the only way I found to insert PHP generated pictures in a HTML page.
JM