1

i'm using and url from Facebook to insert into HTML img src .. that url is not an image, this url (when opened on a browser) redirects to an image.

 <img src="https://graph.facebook.com/274084006029120/picture?width=100" />

This image is shown correctly everywhere.

Then I build a cover.php program that only redirect to an http://../image.jpg

Then i add on HTML source

 <img src="https://.../cover.php" />

On most browsers and emails this cover.php program Works fine and shows the picture. But on some components (editors) seems the php is not executed and the picture is not show.

How can i solve this ? or how can i do redirect (need some code before) to work like Facebook redirect ?

Thanks a lot !

1
  • php is run server side, so the client is irrelevant. Commented Jan 22, 2016 at 0:03

2 Answers 2

1

You can redirect browser with adding this line to your php code:

header('Location: http://..../image_url');
Sign up to request clarification or add additional context in comments.

1 Comment

yes now it's working and redirecting perfect. Thanks
0

Perhaps you can get the redirected url like in this answer

$url = 'https://graph.facebook.com/274084006029120/picture?width=100';

file_get_contents($url);
preg_match('/(Location:|URI:)(.*?)\n/', implode("\n", $http_response_header), $matches);

if (isset($matches[0]))
{
    echo "<img src='".matches[0]."' />";
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.