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 !

Oscar Jofre
  • 153
  • 3
  • 17

2 Answers2

1

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

header('Location: http://..../image_url');
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]."' />";
}
Community
  • 1
  • 1
meda
  • 45,103
  • 14
  • 92
  • 122