...

View Full Version : PHP external image permission



cat250
01-12-2012, 06:29 PM
Hello.

I have a problem with my script, hope someone can help me. :)
Let's explain: I use
echo "<img src='".$json['Poster']."' />"; and get in return what I need:
<img src='http://ia.media-imdb.com/images/M/MV5BMTU2ODI1NTM4NF5BMl5BanBnXkFtZTcwNTY0MDcyMQ@@._V1_SX320.jpg' />

On localhost it's ok, image is displayed, but somewhere else the image isn't showed. In source code it's ok, so I tried to open image in a new tab to see where is the problem and I get that:


Referral Denied
You don't have permission to access "http://ia.media-imdb.com/images/M/MV5BMTU2ODI1NTM4NF5BMl5BanBnXkFtZTcwNTY0MDcyMQ@@._V1_SX320.jpg" on this server.
Reference #24.4d16150.1326392826.b6dc10bf

So, know someone how I can show the picture? I think cache or something... but I don't know how to do that.

If u need something from the script say here. :p - and sorry for bad english, not native language.

Thanks! :thumbsup:

mlseim
01-12-2012, 07:49 PM
It works fine for me ... in my browser and inside of a test PHP script.

You'll have to show us the scripting you have ... where it doesn't work.

cat250
01-12-2012, 08:27 PM
It works fine for me ... in my browser and inside of a test PHP script.

You'll have to show us the scripting you have ... where it doesn't work.


mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("movies") or die(mysql_error());
$f = mysql_query("SELECT * FROM movies") or die(mysql_error());
while($inf = mysql_fetch_assoc($f)) {
$two= $inf['id'];
$link = "http://www.imdbapi.com/?i=$two";
$thr = file_get_contents($link);
$json = json_decode($thr,true);
echo "<img src='".$json['Poster']."' />";

I looked in source code (browser) and return exactly what I need:

<img src='http://ia.media-imdb.com/images/M/MV5BMTU2ODI1NTM4NF5BMl5BanBnXkFtZTcwNTY0MDcyMQ@@._V1_SX320.jpg' />

http://i.imgur.com/bBcNW.png

and result:

http://i.imgur.com/eq536.png

Thank you!

mlseim
01-12-2012, 09:23 PM
I guess I'm stumped ... I'm not sure where the error is coming from.
Maybe someone else might have an answer.

Kekke
01-12-2012, 09:32 PM
imdb does not allow hot-linking their images.

You will have to download them and upload them to another host.

tracknut
01-12-2012, 10:52 PM
imdb does not allow hot-linking their images.

You will have to download them and upload them to another host.

They don't allow that either:



Copyright
All content included on this site, such as text, graphics, logos, button icons, images, audio clips, video clips, digital downloads, data compilations, and software, is the property of IMDb or its content suppliers and protected by United States and international copyright laws. The compilation of all content on this site is the exclusive property of IMDb and protected by U.S. and international copyright laws. All software used on this site is the property of IMDb or its software suppliers and protected by United States and international copyright laws.

cat250
01-12-2012, 11:44 PM
imdb does not allow hot-linking their images.

You will have to download them and upload them to another host.

Know someone how I can do this? :) Thanks!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum