Page 1 of 1

PHP as a stand-alone Image server

Posted: Wed Aug 11, 2004 6:47 am
by soul8o8
Yo!

I want an apache/php server to act as an image server for other web sites.
I.e they (the other websites) can write in their html-file:

<img src="myL33tImageServer.net/getImage.php?login=user&file=weather.gif" etc etc>

-- And my server will send an image.

Now, Is that possible? Can a PHP-script send itself as an image? Or is there any other, preferably better, solution? We can assume that the "client" websites have php as well...

The thing is the images get created at runtime and on request so i dont want a regular

<img src="mywebsite.net/image_1234.gif">

I need php inbetween :) How?


(im new here, let me know if there's an initiation ritual ;)

hi-5!
/soul8o8

Posted: Wed Aug 11, 2004 11:52 am
by feyd
yes, php can pass images with the gd functions, or reading them like a download functionality to the requestor..

The only major thing your php would need to do is change the content-type being sent to the browser, so the browser knows how to read it.

Code: Select all

[php_man]header[/php_man]('Content-type: image/jpeg');
for instance...