help with displaying php content on another website from a different server.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zigby
    New Member
    • Apr 2010
    • 2

    #1

    help with displaying php content on another website from a different server.

    HI there,

    I am new to PHP and a lot of other web development languages so any help in laymens terms would be great.

    This is my problem:

    I have been given 2 links to php urls that display a list and search page of my clients used cars from another content management providers database.

    I need to know what is the best way to represent this up to date data on the clients website. Currently I am using an Iframe which does everything I want except integrate seamlessly with the design of the site.

    IS there a way in PHP to do this better? I have tried using php inlcude however the url contains links which once activated navigate away from the clients website. Is echo better? Does it inlcude the entire site?

    I am not even sure I am heading in the right direction here, any help would be great!
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    So basically, you need to take data from website A, which you don't own yourself, and put it into website B, which you own?

    You could do that in PHP by fetching the page with the data, using something like Curl or just simply file_get_conten ts, and then searching the HTML (I assume it is HTML?) for the data.

    Searching the page is tricky, and depends very much on what the data is and how it is presented. You can use anything from the String Functions or Regular Expressions to DOM parsers or XML Parsers.

    If you only want to "copy" the HTML from the site into your own, you could always replicate the external resources it uses on your own server, and simply have PHP replace the URLs in the HTML before printing it.

    Comment

    • zigby
      New Member
      • Apr 2010
      • 2

      #3
      Thanks for the run down, that makes sense. I only want to copy the data and change the presentation of it so hopefully would not need to get into searching it. The problem occurs as it is an ever changing database which may have an ever changing amount of pages displayed. Is there a way I can read all possible pages at once?

      Comment

      Working...