Re: PHP-created PNG image on same page as text?

From: Date: Sun, 26 Nov 2000 16:14:58 +0000
Subject: Re: PHP-created PNG image on same page as text?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27265@lists.php.net to get a copy of this message
There are few ways for this: 1.If you want to display the image on the next page: create the form and set the action of it to the php script the generate the images based on the POSTed vars. This is quite simple to implement but not very nice (You get a page with an image on it, and no additonal text/navigation links, etc. Quite ugly IMO). 2. Display the image on the same page: Set the form to post vars to itself, and pass the values POSTed to the image script (don't forget to URL encode them). e.g. <IMG SRC="make_image.php?text=blabla&color=blue"> where text and color are the values entered in the form. That way you can place the image below the form. The drwaback to this method is that users can view the source of your image and call the image script directly with their own params, and bypass the form. In that way they can place images on their site linked directly to yours (that's bandwith stealing). 3. Similar to #2 but instead store the vars POSTed in session variables, do <IMG SRC="make_image.php"> and on make_image.php read the values from the session registered vars and generate your image. That way no one can see the values passed to your script. HTH -- Meir Kriheli MKsoft computer systems 'There's someone in my head but it's not me" - Pink Floyd ----- Original Message ----- From: "ictuss" <ictuss@prodigy.net> To: "Meir Kriheli - MKsoft" <mksoft@netvision.net.il>; <php-general@lists.php.net> Sent: Sunday, November 26, 2000 5:25 PM Subject: RE: [PHP] PHP-created PNG image on same page as text? > That gets me started in the right direction ... Now if I want to create an > image based on the information > obtained in a form, then display that new image, would I : > > 1. create a page with the form action "the_image_script.php" > > ???? > > Then how would I get back? The more I think, the more confused I get ... > > > Here's what I want to do: > 1. collect info in form > 2. create image based on that info > 3. display image on next page (or even the same page as the form, if > possible). > > Geez, this is harder than I thought ! > > Thanks to everyone for their help. > > Kenn > > > > -----Original Message----- > From: Meir Kriheli - MKsoft [mailto:mksoft@netvision.net.il] > Sent: Sunday, November 26, 2000 9:13 AM > To: ictuss; php-general@lists.php.net > Subject: Re: [PHP] PHP-created PNG image on same page as text? > > > Sure you can, > > Create the page as you normally would. > > To place an image do > > <IMG src="the_path _to_your_image_script.php"> > > Meir Kriheli > MKsoft computer systems > > 'There's someone in my head but it's not me" - Pink Floyd > > ----- Original Message ----- > From: "ictuss" <ictuss@prodigy.net> > To: <php-general@lists.php.net> > Sent: Sunday, November 26, 2000 4:56 PM > Subject: [PHP] PHP-created PNG image on same page as text? > > > > I'm doing my first experiments this morning > > with GD and PNG ... > > > > I can create a page that ONLY has my PNG image > > on it and no HTML ... but is it possible to > > have text -- maybe even a form -- followed by > > my PHP-created image? I need more than just the > > image on the page, and I can't figure out how to > > do that... SURELY it's possible, or else what good > > would it do to dynamically create an image? > > > > I must be overlooking something ... PLEASE HELP. > > > > Thanks, > > > > Kenn

« previous php.general (#27265) next »