sending requests to HTTP server and receiving HTML

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
sad69
Forum Newbie
Posts: 3
Joined: Fri Jan 30, 2004 2:35 pm

sending requests to HTTP server and receiving HTML

Post by sad69 »

Hi all,

I would like to know how I might be able to do something using PHP (or some other technology that will allow this...).

What I need to do, and I know that it's possible because this is what web browsers do all the time, is send an HTTP request and receive the HTML file from that server replying to my request.

I've got an HTML file, and it contains a form with all hidden input fields and automatically (using <body onLoad=form.submit()>) submits itself to an asp page on the web.

Basically I'd like to POST all the information from that form to some ASP page on the web, and download the HTML response file so that I can parse its HTML code (using PHP's PERL abilities).

Any and all help would be appreciated!

Thanks,
Sadiq.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

I know you can use fopen() to open a page or URL, but because you are using a form it might be better for you to use cURL. I'm not sure because I've never used it personally. I also came across an interesting page for using cURL and passing FORM variables without hidden fields:
http://www.alt-php-faq.org/local/55/
Post Reply