Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

redirect php document to an image

redirect php document to an image

2:42 am on Nov 5, 2002 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 29, 2002
votes: 0

Rather than have <img src="http://xxx.com/image.gif> in my code, I want to create a php document which will respond with the contents of a graphic from another domain. The code I would like to see in my html document would be something like:
<img src=showimage.php?image=image.gif>

I used to do this in ASP using a response.redirect. I guess there is an equivallent in PHP?

6:11 am on Nov 5, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Sept 12, 2002
votes: 0

If you really want to do this with a reidrect, look at the header() function.

You can also use PHP to output data types other than HTML, so it would be quite possible to store the image data any place you like (such as a database) and send it to the user from a php script without a redirect.

What purpose does this serve that linking the image from the other domain directly doesn't?


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members