On Jun 12, 2007, at 9:31 AM, Miretsky, Anya wrote:

I am trying to retrieve and send data to a remote web server using HTTP. [...] Can anyone point me in the right direction?

There are a few ways to do it...

For simple GET requests the easiest is to use file functions that support the HTTP protocol, like fopen() or file(). (The php.ini setting allow_url_fopen must be enabled for this to work). EX:

$responseLines = file('http://google.com/');

more details: http://us.php.net/manual/en/features.remote-files.php

For POST request you'll need to use either the curl, or socket functions.

http://us.php.net/manual/en/ref.curl.php
http://us.php.net/manual/en/function.fsockopen.php

PEAR also has an HTTP_Request package. This uses the socket functions internally, but is much simpler to work with.

http://pear.php.net/package/HTTP_Request

Hope this helps.

-- Dell


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to