PDA

View Full Version : php image



Johnnymushio
04-15-2007, 12:37 AM
$image = imageCreateFromGIF("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?clrimg');


how can i make that point to the file within the site.

not http

mburt
04-15-2007, 12:49 AM
Save it as a php file, then use an img tag:

<img src="phpimage.php">

Johnnymushio
04-15-2007, 07:22 PM
that did not work

Twey
04-15-2007, 07:31 PM
You can't, the "file" isn't an image, it's the output of a script. The image data is embedded (base64-encoded) in the PHP file, if I remember correctly.

tech_support
04-16-2007, 10:36 AM
You can, if it has a Content-Type header of Image.


header("Content-Type: image/gif");

Twey
04-16-2007, 04:42 PM
No, since unless it's accessed via HTTP, the script won't be executed, and the function will be trying to parse the script text as a GIF image.

mburt
04-16-2007, 07:33 PM
The script returns a GIF file if you do it correctly.

djr33
04-16-2007, 10:15 PM
Then run it through HTTP. Do it some roundabout way if needed...

Twey
04-16-2007, 10:18 PM
That's what's already happening, from the look of it.

djr33
04-16-2007, 10:21 PM
Ah, missed that.

Well, problem simplified to no point in trying to 'fix' it as the solution seems present already.

What's wrong with using http anyway?

Johnnymushio
04-19-2007, 01:04 AM
if u go to japantown.awardspace.com/generalchat.php?frames an try to select a color an error comes up

i did something to japan chat so it has diff error messsages, so ignore those