Is it possible to run an external page on the client and get the JSON result using PHP?

Asked

Viewed 47 times

0

good afternoon!

The following is, I have a URL of a forum on the Internet that when accessing it it returns in JSON format the last posts viewed by a certain user. As it is external do not know how it works and I believe it is by the cookies that the forum left on the user’s computer.

I wanted to use this URL for when the user enters my site I put something like: "5 Last posts viewed by you in FORUM TAL".

But to do that this URL would have to be executed somehow in the client’s browser and I would still have to have access to the content returned by this URL.

There is the possibility that I can do this using PHP or some other technology?

Thank you!

  • Is this url public? Or is it only available to you, developer? This forum does not provide an API?

  • Through a iframe you will probably be able to put the last posts viewed.

  • The API is deprived of them, not to mention that posts appear when the URL is executed because only they can read cookies. In the case of iframe someone has some example?

  • 1

    I’ll take some tests and answer

1 answer

2


You can use Ajax for this. Ex:

$.ajax({
  type: 'GET',
  url: 'URL DE RETORNO JSON',
  dataType: 'json',
  success: function(data){
    $('body').append(data.titulo);
  }
})

in case it is only modify as the return of JSON

  • I tested here worked well friend! Thanks!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.