Jump to content


This topic is now archived and is closed to further replies.


PHP Header proxy for images

Recommended Posts


Have a bit of a strange idea and not sure if it will work. I have tested the first bit and its ok. So if you have a [b]Server A[/b] that called an imabe from [b]Server B[/b] instead of calling the image though it goes like so:
[b]<img src="getimage.php" width="274" height="199" />[/b]

This then calls a PHP script instead which i have tested and it does run the script. Now what i want to do is make it so that this script will pass back an image like its supposed. What this allows me to do then is make the script randomly pick photos from [b]Server C[/b] and then pass them to the page on [b]Server A[/b].

The reason for this complicated method is because no scripting is allowed on [b]Server A[/b] and so the only way to get random images on it is like that. Can the headers be modified so that the getimage.php script acts as a kind of proxy/image redirect ?


Share this post

Link to post
Share on other sites
Some things that i guess i should post with it. This is links that i have found a close as i can to the topic:

[url=http://www.expertsrt.com/tutorials/Matt/HTTP_headers.html]http://www.expertsrt.com/tutorials/Matt/HTTP_headers.html[/url]  Good one on headers.
[url=http://www.spoono.com/php/tutorials/tutorial.php?id=42]http://www.spoono.com/php/tutorials/tutorial.php?id=42[/url]  On Images
[url=http://www.webmasterworld.com/forum88/9077.htm]http://www.webmasterworld.com/forum88/9077.htm[/url]  On Images

Share this post

Link to post
Share on other sites
Make the file a function.. and make it return an image name... then do this in Server A:

<img src="<?php echo getimage(); ?>" \>

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.