Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4048352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:48:23+00:00 2026-05-20T13:48:23+00:00

I am trying to obtain and display a remote image from a url in

  • 0

I am trying to obtain and display a remote image from a url in PHP. Most images work, however some images redirect for example:

http://thundafunda.com/33/World-tour/download/Grand%20Canal,%20Venice,%20Italy%20pictures.jpg

The image would load and then disappear. I am using an IMG tag and placing that url as the source. Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:48:24+00:00Added an answer on May 20, 2026 at 1:48 pm

    Using this portion of code, that doesn’t do anything except display an <img> tag :

    $url = 'http://thundafunda.com/33/World-tour/download/Grand%20Canal,%20Venice,%20Italy%20pictures.jpg';
    echo '<img src="' . $url . '" alt="" />';
    

    I get the same kind of behavior you are describing : the image is not displayed.

    If I take a look at what’s happening on the network level, using Firebug, I see this :


    (source: pascal-martin.fr)

    Basically :

    • A request is made to load the image
    • The image loads
    • But the response comes with :
      • a 302 HTTP status code
      • That redirects to the URL given in the Location header of the response — which points to an HTML page
    • So, the browser follows that redirection
    • and loads an HTML page

    Which, of course, cannot be displayed in an <img> tag.


    If you do exactly the same test, disabling the Referer (some Firefox extensions can do that), you’ll see the image is displayed properly — and Firebug says :


    (source: pascal-martin.fr)

    Note that there is no Referer header, this time, in the Request sent from my Browser.

    Considering this, I would bet there is some kind of anti-hot-linking protection that’s been setup by the website hosting that image…

    And there is not much you can do, except host the file on your own server — if the licence allows you to.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display some images in one ImageView to obtain the functionality
I'm trying to obtain the most liked comments from a video of my choice
I am trying to obtain some information from a webpage that requires login. I
I am trying to obtain the url from the innerHTML of a web page
I'm trying to display a page in NSIS to obtain two different values. I
I'm trying to obtain the price from a field called DiscountMarkupPriceRate1 on my second
Im trying to obtain javascript .js files from a website using beautifulsoup. This is
I'm trying to obtain a list of videos from Youtube to be displayed on
When trying to obtain an array of objects from an IEnumerable collection of objects
I'm trying to obtain credentials from ning network using Coldfusion 9, so first this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.