Getting contents of modified Image.php

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Getting contents of modified Image.php

Post by violet »

I just realized I was posting in the wrong section of the forums...oops. Hehe :D (Not to say that the people in the other section weren't helpful, because they were..)

OK. So. Values (text) are passed on to my Image.php using a Form with method=GET.

This way the URL becomes Image.php?Var1=Value1&Var2=Value2&Var3=Value3 & so on

How do I get the contents of my modified Image.php?

Because when I refer to my Image.php as simply Image.php it gets the basic ("initial") values of Var1 & Var2 & Var3 and not the values passed on to it using the form with method=GET.

The particular function I am using in my SendMail.php, require(), won't accept Image.php?Var1=Value1&Var2=Value2&Var3=Value3 & include doesn't recognize Image.php as an image at all (for some weird reason).

If there's perhaps another way of doing this whole shebang pls. recommend/suggest it.

Thanks :)
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Personally, I'd make the code that generates the image into a function (or an object) that returns the image data, and then just call it like any other function. Trying to fetch the output of a script is possible (using cURL for example) but it'll be much slower than keeping everything within PHP.
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Post by violet »

Is there any other way to modify/pass values on to Image.php other than using a form with a get method?

I'm going in circles because it seems a form with a Get method is the only way to pass values on to Image.php and using require() is the only sure way to send the PHP image to an email address as an attachment (however require() won't accept anything like Image.php?Var1=Value1&Var2=Value2&Var3=Value3)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Is Image.php an image itself? I think you could just use it as an image file.

Code: Select all

<img src="Image.php?var1=1&var2=2&var3=3" />
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Post by violet »

Hello again superdezign!!!! :D

Do I insert that under this part?

$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"

Or under the attachments part?

$message .= "Content-Type: image/gif; name=\"XYZ.gif\"\r\n"
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

No idea what you're asking. I'm saying that if the PHP is treated as it's own image (with image header's and all) it can be used anywhere else as an image.
User avatar
violet
Forum Newbie
Posts: 24
Joined: Wed May 23, 2007 12:13 pm
Location: Manila, Philippines
Contact:

Post by violet »

Ah, well I thought maybe I could simply add image.php as an attachment that way. I do think attaching it this way..with the img src tag, will allow the extensions

Code: Select all

image.php?var1=1&var2=2&var3=3
to be included :D Thanks
Post Reply