Collecting data from external site

Hi! I was trying to collect some data from a page (based on user selection) for later analysis, but it involved iframe to display the source page. Unfortunately I found out that there are no way to get content (selection) from iframes since they are from a different domain. Any ideas how to solve this problem, perhaps, in another way - I mean collecting data from other site with interaction of a user?

Well, there is, but you need to be very careful here. A lot of sites do not allow direct usage of their data on your own site.

Yes, I’m fully aware of this - I’m not planning to give users an access to any site.

So is there any php solutions out there, because until this moment I haven’t found one. Or is the only solution based on development of plugins, toolbars etc?

The method is known as ‘screen-scraping’. You use [FPHP]cURL[/FPHP] or the [FPHP]fopen[/FPHP]/[FPHP]file_get_contents[/FPHP] sections to retrieve the data, and then parse it to extract what you want from it.

Perhaps I misunderstood your answer, but the problem isn’t in getting all of the content from a site. When I said “based on user selection”, I meant that I want to collect only user-selected content, like only 1 table row:

<tr>
 <td>phone cell</td>
 <td>address cell</td>
</tr>

and then parse it, instead of getting HTML of all the page. So the user somehow must interact with the system, to tell what part of the site does he want.

… it’s really starting to sound like you’re trying to use another person’s site as your own.

You’d have to download the whole thing, extract the options from that download, present them to the user. The user would make a selection, and you’d pass the whole datablock to your form handler to extract the value in question.