Getting HTML from a remote site

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
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Getting HTML from a remote site

Post by Ree »

Is there a way to simulate user request of a remote page (on another server) and get the contents of the output? To make it more clear: normally some user submits a form on somesite.com and as a result gets the HTML output on that site. I want to do this: some user submits a form on mysite.com (which is actually submitted to somesite.com) and I want to modify the HTML output generated by somesite.com (the HTML should be identical to that outputted if the user submitted the form on somesite.com itself) and display it on mysite.com. Is there a way to do this kind of stuff?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

I've not used it myself, but it sounds like you need to use the wonders of the cURL library :)
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

Post by Ree »

Yeah, that's exatctly what I need. VERY nice thingy. :)
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

You can alternately use fopen and the rest of the lot. That only works if you have necessary access rights to the file.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

Jenk wrote:I've not used it myself
Why, didn't you get time...? its pretty easy and sometimes very handy too. jus' asking :)
Post Reply