SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    50
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

    Issue interacting with Third Party API on live site

    WEBSITE NOT WORKING WHEN HOSTED!!!

    Please please help me. This is my first created website. My problem is very strange. After weeks of hard work, when I am seeing my website is not working, I have started crying

    The problem is, website is working correctly in my computer+LOCALHOST. But when I host website, the website is not working. I have tried tried 2 free different webhosts and currently using JABRY.net I cannot but use free hosts like this.

    Site: http://users9.Jabry.com/postarian

    Website is simple. It delivers your movie posters using the open API omdbapi.com. Posters are not loading when I host the website, but all the functions are working correctly in my PC. Very strange! Try it yourself.

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,443
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    Hi Ahmed,

    Your code seems to be working OK - the problem is that when you try to load the poster image, the IMDB server is returning a 403 (forbidden) error. From what I can gather, this is deliberate and is some sort of measure to prevent people hotlinking to their images.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2012
    Posts
    50
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by fretburner View Post
    Hi Ahmed,

    Your code seems to be working OK - the problem is that when you try to load the poster image, the IMDB server is returning a 403 (forbidden) error. From what I can gather, this is deliberate and is some sort of measure to prevent people hotlinking to their images.
    Then how can I load the poster, this is an API, isn't it? I should have access to the images. And if you are right, then it should not work when I try it in my PC locally. But acutually, it's working locally.

  4. #4
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,443
    Mentioned
    45 Post(s)
    Tagged
    13 Thread(s)
    Quote Originally Posted by Ahmed Sadman View Post
    Then how can I load the poster, this is an API, isn't it? I should have access to the images. And if you are right, then it should not work when I try it in my PC locally. But acutually, it's working locally.
    You do have access to the images - you can copy the URL, paste it into your browser, and it will work just fine - but if you try to pull it in from your script then you get the 403 error. Probably running it on your local machine doesn't trigger whatever mechanism IMDB use to protect their images, but once you run it from a webserver it does.

    Here are the links I found from googling the problem, then you don't have to take my word for it:
    http://stackoverflow.com/questions/1...et-a-403-error
    http://stackoverflow.com/questions/1...s-from-another
    http://stackoverflow.com/questions/1...oyed-to-server

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,250
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Ahmed Sadman View Post
    ..... this is an API, isn't it? .....
    Yes, it is an API. And it is working. It is sending the URL of another site ~not~ the image.

    Perhaps you can contact the API's site owner and convince them to host the images on their site?


Bookmarks

Posting Permissions

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