By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,945 Members | 1,540 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,945 IT Pros & Developers. It's quick & easy.

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

P: 2
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!
Apr 7 '10 #1
Share this Question
Share on Google+
2 Replies


Atli
Expert 5K+
P: 5,058
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_contents, 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.
Apr 8 '10 #2

P: 2
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?
Apr 8 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.