Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Unhappy PHP external image permission

    Hello.

    I have a problem with my script, hope someone can help me.
    Let's explain: I use
    Code:
    echo  "<img src='".$json['Poster']."' />";
    and get in return what I need:
    PHP Code:
    <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:

    PHP Code:
    Referral Denied
    You dont 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. - and sorry for bad english, not native language.

    Thanks!

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    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.

  • Users who have thanked mlseim for this post:

    cat250 (01-12-2012)

  • #3
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mlseim View Post
    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.
    PHP Code:
    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:
    Code:
    <img src='http://ia.media-imdb.com/images/M/MV5BMTU2ODI1NTM4NF5BMl5BanBnXkFtZTcwNTY0MDcyMQ@@._V1_SX320.jpg' />


    and result:



    Thank you!

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I guess I'm stumped ... I'm not sure where the error is coming from.
    Maybe someone else might have an answer.

  • #5
    New Coder
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    0
    Thanked 1 Time in 1 Post
    imdb does not allow hot-linking their images.

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

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,311
    Thanks
    11
    Thanked 285 Times in 284 Posts
    Quote Originally Posted by Kekke View Post
    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.

  • #7
    New Coder
    Join Date
    Jan 2012
    Location
    localhost
    Posts
    14
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Kekke View Post
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •