homepage Welcome to WebmasterWorld Guest from 23.20.77.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
redirect php document to an image
redirect php document to an image
shady




msg:1265911
 2:42 am on Nov 5, 2002 (gmt 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?

 

dingman




msg:1265912
 6:11 am on Nov 5, 2002 (gmt 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?

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved