Re: Solution for html source <img="gif_script.php?var..."> ?

From: Date: Fri, 28 Jul 2000 06:36:49 +0000
Subject: Re: Solution for html source <img="gif_script.php?var..."> ?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8717@lists.php.net to get a copy of this message
Thanks Chris, I'm afraid this will not solve my problem, maybe I did not explain it properly. I do not have any problems getting the script to work, it's the html source that bothers me. It will still show <IMG SRC=image.php?Msg=Foo+Bar&Size=12> if the client browser saves the picture/ views the source. And that is something I'm not too happy about, it invites people to play with the img script through their browser, setting font sizes to 68 and that sort of stuff.... Obviously you can't manipulate the html once it has been parsed, but is there a PHP trick that allows me to "rewrite" the output of the image script to a "standard" img src tag before output to the browser? Or is the only solution writing the output of the image script to disk first and then calling it in the html? I'd like to prevent writing to disk first, I'd probably end up writing about a thousand gif files to disk every hour, doesn't seem smart, but I might be wrong about that? Thanks, Matt At 13:56 27-7-00 -0500, Chris Murley wrote:
I do this: file - image.php <?php Header("Content-type: image/gif"); $im =imagecreatefromgif("$IMAGEPATH/appindex_status_display_background.gif"); $black = ImageColorAllocate($im, 0, 0, 0); ImageTTFText($im, 10, 0, 20, 41, $black, "$IncludeDir/font/ARIAL.TTF",$Msg); imageGif($im); ImageDestroy($im); ?> call it like <img src="image.php?Msg=foo"> and poof! On Thu, 27 Jul 2000, Matt wrote: Hi there, All my menu items are taken from a database and rendered into GIF files by PHP. To do this I call a script that takes some vars as well. Any client that will view the output html source or views/saves an image will see something like: <IMG SCR="make_gif.php?var=$var&bla=$bla"> I realize that if I was to write the generated gifs to disk I wouldn't have this problem, but I do not want to do this. (Multiple sites * multiple fonts * multiple colors = A LOT ) Does anybody have a nice work around ? Thanx. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#8717) next »