|
Comments for: allan20000830
| Message # 1015322: |
|
Date: 01/30/03 09:02
By: BossTI89 Subject: RE: GD + HTML i had the same problem but i solved it like this: 1.create a folder with all the perms 2.i create the folowing script: <? $im = ImageCreate($ancho, $alto); $col_fondo = ImageColorAllocate($im, 255, 255, 255); ImageFilledRectangle($im, 0, 0, $ancho, $alto, $col_fondo); $dir = opendir("imagen/"); while ($elemento = readdir($dir)){ if ($elemento !="." and $elemento!=".."){ unlink ("imagen/".$elemento); }} closedir($dir); $filename=rand().".png"; $aux="imagen/".$filename; ImagePng($im,$aux); ImageDestroy($im); ?> <html> <head> <title>Graficos</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? print "<img src=".$aux.">"; ?> </body> </html> with this you erase all in the folder imagen and create the image. Then all you have to do is call it from html. the random is for when you use the same page many time like in my case, in that way you will not have the problem cache. i hope it help you! |
Previous Message | Next Message |


