how to display the contents from a specified URL?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
eyor312
Forum Newbie
Posts: 2
Joined: Wed Aug 11, 2004 3:41 pm

how to display the contents from a specified URL?

Post by eyor312 »

Hi,

I'm new to php and cannot seem to find how to display a page from a URL in PHP. For instance, I have my own wrappers coded and then in the code I have a URL, http://www.google.com.

So when I display my page it would show my customized wrappers and then it would display the google page.

Is this scenario possible? If possible, how do I do it?

Thanks a bunch,
Gabe
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can use [php_man]file_get_contents[/php_man]() or [php_man]curl[/php_man] to get the remote pages.. then use some regular expressions or other string functions to get at the data contained in the rendered html..
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

google offers a API service, you could use that, more information is here-> http://www.google.com/apis/index.html
eyor312
Forum Newbie
Posts: 2
Joined: Wed Aug 11, 2004 3:41 pm

Post by eyor312 »

Thanks for the reply guys.... I look into it and see if it works.
Post Reply